changeset 54846:e8865bfda38b

(Fformat): Fix allocation size of precision array.
author Kim F. Storm <storm@cua.dk>
date Tue, 13 Apr 2004 21:30:16 +0000
parents 5e651158130c
children 5acc1d864551
files src/editfns.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Tue Apr 13 20:21:43 2004 +0000
+++ b/src/editfns.c	Tue Apr 13 21:30:16 2004 +0000
@@ -3220,7 +3220,7 @@
      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 @@
   /* 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;