summaryrefslogtreecommitdiff
path: root/src/doprnt.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-03-07 18:59:00 +0000
committerKarl Heuer <kwzh@gnu.org>1994-03-07 18:59:00 +0000
commit5a51a17cc469d440572622c0bb78483c0ad78def (patch)
tree77d252a13327b21a1aa7f6dc6a1d9e3e053c750c /src/doprnt.c
parentcaa0d9ca2f0cd5cc5d3ecc71079ea26d83a1d624 (diff)
downloademacs-5a51a17cc469d440572622c0bb78483c0ad78def.tar.gz
(doprnt): Do the right thing for negative size spec.
Diffstat (limited to 'src/doprnt.c')
-rw-r--r--src/doprnt.c3
1 files changed, 2 insertions, 1 deletions
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)