diff options
author | Kim F. Storm <storm@cua.dk> | 2004-07-30 12:05:32 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2004-07-30 12:05:32 +0000 |
commit | 7c111482b974625610a81b698556a47d8dfa772b (patch) | |
tree | 380880b365485c7f0045ce0c2f3376dc389be680 /src/editfns.c | |
parent | ee945d083910ee9d0af23008806ba3cf2edcd5b4 (diff) | |
download | emacs-7c111482b974625610a81b698556a47d8dfa772b.tar.gz |
(Fformat): Allocated extra (dummy) element in info.
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 5 |
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])); |