From: Kim F. Storm Date: Tue, 13 Apr 2004 21:30:16 +0000 (+0000) Subject: (Fformat): Fix allocation size of precision array. X-Git-Tag: ttn-vms-21-2-B4~6855 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d68de522ca10547a4d26e457c0e05639498051d1;p=emacs.git (Fformat): Fix allocation size of precision array. --- diff --git a/src/editfns.c b/src/editfns.c index ce075f2696c..a5c3aea14bc 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3220,7 +3220,7 @@ usage: (format STRING &rest OBJECTS) */) string itself, will not be used. Element NARGS, corresponding to no argument, *will* be assigned to in the case that a `%' and `.' occur after the final format specifier. */ - int *precision = (int *) (alloca(nargs * sizeof (int))); + int *precision = (int *) (alloca((nargs + 1) * sizeof (int))); int longest_format; Lisp_Object val; int arg_intervals = 0; @@ -3274,7 +3274,7 @@ usage: (format STRING &rest OBJECTS) */) /* Make room in result for all the non-%-codes in the control string. */ total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]); - /* Allocate the info and discarded tables. */ + /* Allocate the info and discarded tables. */ { int nbytes = nargs * sizeof *info; int i;