mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-27 07:41:28 -08:00
(doprnt): Do the right thing for negative size spec.
This commit is contained in:
parent
9f6c23bc36
commit
dfd351ef6d
1 changed files with 2 additions and 1 deletions
|
|
@ -94,11 +94,12 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
|
|||
}
|
||||
*string = 0;
|
||||
/* Get an idea of how much space we might need. */
|
||||
size_bound = atoi (&fmtcpy[1]) + 50;
|
||||
size_bound = atoi (&fmtcpy[1]);
|
||||
|
||||
/* Avoid pitfall of negative "size" parameter ("%-200d"). */
|
||||
if (size_bound < 0)
|
||||
size_bound = -size_bound;
|
||||
size_bound += 50;
|
||||
|
||||
/* Make sure we have that much. */
|
||||
if (size_bound > size_allocated)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue