summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)