Mercurial > emacs
comparison src/editfns.c @ 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 | 0240cb0709d0 |
children | 1b09eb24ab02 |
comparison
equal
deleted
inserted
replaced
54845:5e651158130c | 54846:e8865bfda38b |
---|---|
3218 /* Precision for each spec, or -1, a flag value meaning no precision | 3218 /* Precision for each spec, or -1, a flag value meaning no precision |
3219 was given in that spec. Element 0, corresonding to the format | 3219 was given in that spec. Element 0, corresonding to the format |
3220 string itself, will not be used. Element NARGS, corresponding to | 3220 string itself, will not be used. Element NARGS, corresponding to |
3221 no argument, *will* be assigned to in the case that a `%' and `.' | 3221 no argument, *will* be assigned to in the case that a `%' and `.' |
3222 occur after the final format specifier. */ | 3222 occur after the final format specifier. */ |
3223 int *precision = (int *) (alloca(nargs * sizeof (int))); | 3223 int *precision = (int *) (alloca((nargs + 1) * sizeof (int))); |
3224 int longest_format; | 3224 int longest_format; |
3225 Lisp_Object val; | 3225 Lisp_Object val; |
3226 int arg_intervals = 0; | 3226 int arg_intervals = 0; |
3227 | 3227 |
3228 /* discarded[I] is 1 if byte I of the format | 3228 /* discarded[I] is 1 if byte I of the format |
3272 longest_format = 0; | 3272 longest_format = 0; |
3273 | 3273 |
3274 /* Make room in result for all the non-%-codes in the control string. */ | 3274 /* Make room in result for all the non-%-codes in the control string. */ |
3275 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]); | 3275 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]); |
3276 | 3276 |
3277 /* Allocate the info and discarded tables. */ | 3277 /* Allocate the info and discarded tables. */ |
3278 { | 3278 { |
3279 int nbytes = nargs * sizeof *info; | 3279 int nbytes = nargs * sizeof *info; |
3280 int i; | 3280 int i; |
3281 info = (struct info *) alloca (nbytes); | 3281 info = (struct info *) alloca (nbytes); |
3282 bzero (info, nbytes); | 3282 bzero (info, nbytes); |