Index: src/birth.c =================================================================== RCS file: /home/angband/angband/angband/src/birth.c,v retrieving revision 1.15 diff -u -r1.15 birth.c --- src/birth.c 2001/05/01 18:11:10 1.15 +++ src/birth.c 2001/05/17 19:44:54 @@ -1186,7 +1186,7 @@ strcpy(inp, ""); /* Get a response (or escape) */ - if (!askfor_aux(inp, 8)) inp[0] = '\0'; + if (!askfor_aux(inp, 9)) inp[0] = '\0'; /* Hack -- add a fake slash */ strcat(inp, "/"); Index: src/cmd2.c =================================================================== RCS file: /home/angband/angband/angband/src/cmd2.c,v retrieving revision 1.10 diff -u -r1.10 cmd2.c --- src/cmd2.c 2001/03/29 18:29:40 1.10 +++ src/cmd2.c 2001/05/17 19:44:54 @@ -2250,7 +2250,7 @@ strcpy(out_val, "&"); /* Ask for duration */ - if (!get_string(p, out_val, 4)) return; + if (!get_string(p, out_val, 5)) return; /* Rest until done */ if (out_val[0] == '&') Index: src/files.c =================================================================== RCS file: /home/angband/angband/angband/src/files.c,v retrieving revision 1.45 diff -u -r1.45 files.c --- src/files.c 2001/05/01 18:11:10 1.45 +++ src/files.c 2001/05/17 19:44:54 @@ -2855,7 +2855,7 @@ strcpy(tmp, op_ptr->full_name); /* Prompt for a new name */ - if (get_string("Enter a name for your character: ", tmp, 15)) + if (get_string("Enter a name for your character: ", tmp, sizeof(tmp))) { /* Use the name */ strcpy(op_ptr->full_name, tmp); Index: src/util.c =================================================================== RCS file: /home/angband/angband/angband/src/util.c,v retrieving revision 1.29 diff -u -r1.29 util.c --- src/util.c 2001/05/01 18:11:11 1.29 +++ src/util.c 2001/05/17 19:44:54 @@ -2830,9 +2830,8 @@ * Return accepts the current buffer contents and returns TRUE. * Escape clears the buffer and the window and returns FALSE. * - * Note that 'buf' must be able to hold 'len+1' characters, not just 'len' - * characters, as might be expected. That is, 'len' primarily refers to - * the input, not the buffer itself. + * Note that 'len' refers to the size of the buffer. The maximum length + * of the input is 'len-1'. */ bool askfor_aux(char *buf, int len) { @@ -2860,7 +2859,7 @@ if (x + len > 80) len = 80 - x; /* Truncate the default entry */ - buf[len] = '\0'; + buf[len-1] = '\0'; /* Display the default answer */ @@ -2903,7 +2902,7 @@ default: { - if ((k < len) && (isprint(ch))) + if ((k < len-1) && (isprint(ch))) { buf[k++] = ch; } @@ -3009,7 +3008,7 @@ sprintf(buf, "%d", amt); /* Ask for a quantity */ - if (!get_string(prompt, buf, 6)) return (0); + if (!get_string(prompt, buf, 7)) return (0); /* Extract a number */ amt = atoi(buf); Index: src/wizard2.c =================================================================== RCS file: /home/angband/angband/angband/src/wizard2.c,v retrieving revision 1.18 diff -u -r1.18 wizard2.c --- src/wizard2.c 2001/05/01 07:25:50 1.18 +++ src/wizard2.c 2001/05/17 19:44:54 @@ -157,7 +157,7 @@ sprintf(tmp_val, "%d", p_ptr->stat_max[i]); /* Query */ - if (!get_string(ppp, tmp_val, 3)) return; + if (!get_string(ppp, tmp_val, 4)) return; /* Extract */ tmp_int = atoi(tmp_val); @@ -175,7 +175,7 @@ sprintf(tmp_val, "%ld", (long)(p_ptr->au)); /* Query */ - if (!get_string("Gold: ", tmp_val, 9)) return; + if (!get_string("Gold: ", tmp_val, 10)) return; /* Extract */ tmp_long = atol(tmp_val); @@ -191,7 +191,7 @@ sprintf(tmp_val, "%ld", (long)(p_ptr->exp)); /* Query */ - if (!get_string("Experience: ", tmp_val, 9)) return; + if (!get_string("Experience: ", tmp_val, 10)) return; /* Extract */ tmp_long = atol(tmp_val); @@ -209,7 +209,7 @@ sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp)); /* Query */ - if (!get_string("Max Exp: ", tmp_val, 9)) return; + if (!get_string("Max Exp: ", tmp_val, 10)) return; /* Extract */ tmp_long = atol(tmp_val); @@ -563,25 +563,25 @@ p = "Enter new 'pval' setting: "; sprintf(tmp_val, "%d", o_ptr->pval); - if (!get_string(p, tmp_val, 5)) return; + if (!get_string(p, tmp_val, 6)) return; o_ptr->pval = atoi(tmp_val); wiz_display_item(o_ptr); p = "Enter new 'to_a' setting: "; sprintf(tmp_val, "%d", o_ptr->to_a); - if (!get_string(p, tmp_val, 5)) return; + if (!get_string(p, tmp_val, 6)) return; o_ptr->to_a = atoi(tmp_val); wiz_display_item(o_ptr); p = "Enter new 'to_h' setting: "; sprintf(tmp_val, "%d", o_ptr->to_h); - if (!get_string(p, tmp_val, 5)) return; + if (!get_string(p, tmp_val, 6)) return; o_ptr->to_h = atoi(tmp_val); wiz_display_item(o_ptr); p = "Enter new 'to_d' setting: "; sprintf(tmp_val, "%d", o_ptr->to_d); - if (!get_string(p, tmp_val, 5)) return; + if (!get_string(p, tmp_val, 6)) return; o_ptr->to_d = atoi(tmp_val); wiz_display_item(o_ptr); } @@ -862,7 +862,7 @@ sprintf(tmp_val, "%d", o_ptr->number); /* Query */ - if (get_string("Quantity: ", tmp_val, 2)) + if (get_string("Quantity: ", tmp_val, 3)) { /* Extract */ tmp_int = atoi(tmp_val); @@ -1174,7 +1174,7 @@ sprintf(tmp_val, "%d", p_ptr->depth); /* Ask for a level */ - if (!get_string(ppp, tmp_val, 10)) return; + if (!get_string(ppp, tmp_val, 11)) return; /* Extract request */ p_ptr->command_arg = atoi(tmp_val);