From: Karl Heuer Date: Mon, 7 Mar 1994 18:59:00 +0000 (+0000) Subject: (doprnt): Do the right thing for negative size spec. X-Git-Tag: emacs-19.34~9616 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dfd351ef6d487356a70c3771b3e710a9ca0cc6cb;p=emacs.git (doprnt): Do the right thing for negative size spec. --- diff --git a/src/doprnt.c b/src/doprnt.c index 7abe5fa3a6b..303846124f4 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -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)