# HG changeset patch # User Kim F. Storm # Date 1081891816 0 # Node ID e8865bfda38be023f67fd94ffd9ab03fa78053d3 # Parent 5e651158130c9e32ce154b31e8a2f6be06da07fc (Fformat): Fix allocation size of precision array. diff -r 5e651158130c -r e8865bfda38b src/editfns.c --- 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;