# HG changeset patch # User Kim F. Storm # Date 1091189108 0 # Node ID 1a84eb100ef33a9604b1014dceb91a1bb3475da6 # Parent ac573231cc6d5f8955a32a349fb8e50f1f9acb38 (Fformat): Allocated extra (dummy) element in info. diff -r ac573231cc6d -r 1a84eb100ef3 src/editfns.c --- a/src/editfns.c Thu Jul 29 01:49:07 2004 +0000 +++ b/src/editfns.c Fri Jul 30 12:05:08 2004 +0000 @@ -3254,6 +3254,7 @@ /* 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 @@ /* 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]));