summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c
index a506c5f4fc8..88a0e63118f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3254,6 +3254,7 @@ usage: (format STRING &rest OBJECTS) */)
/* Piggyback on this loop to initialize precision[N]. */
precision[n] = -1;
}
+ precision[nargs] = -1;
CHECK_STRING (args[0]);
/* We may have to change "%S" to "%s". */
@@ -3277,11 +3278,11 @@ usage: (format STRING &rest OBJECTS) */)
/* Allocate the info and discarded tables. */
{
- int nbytes = nargs * sizeof *info;
+ int nbytes = (nargs+1) * sizeof *info;
int i;
info = (struct info *) alloca (nbytes);
bzero (info, nbytes);
- for (i = 0; i < nargs; i++)
+ for (i = 0; i <= nargs; i++)
info[i].start = -1;
discarded = (char *) alloca (SBYTES (args[0]));
bzero (discarded, SBYTES (args[0]));