# HG changeset patch # User Karl Heuer # Date 763066740 0 # Node ID d9f09620009955db25946bca9f21b40206a052ff # Parent d93350e9d2bcfd9f2b30c70ceeb60dcb93578f38 (doprnt): Do the right thing for negative size spec. diff -r d93350e9d2bc -r d9f096200099 src/doprnt.c --- a/src/doprnt.c Mon Mar 07 18:55:55 1994 +0000 +++ b/src/doprnt.c Mon Mar 07 18:59:00 1994 +0000 @@ -94,11 +94,12 @@ } *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)