aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1995-08-07 17:52:16 +0000
committerRichard M. Stallman <[email protected]>1995-08-07 17:52:16 +0000
commit6e9517285f9cc9bafec534bc3198cc0e099978bc (patch)
tree4764dcccf54ca8aaac46cf50b3462b3bae8542eb
parenta7e9dc1d14b9f1af284deba0555b1ebfdee08d31 (diff)
(doprnt): Don't let size_bound be gigantic. Fix error message.
-rw-r--r--src/doprnt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/doprnt.c b/src/doprnt.c
index 24eea1e70f..63f724cf7a 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -104,6 +104,11 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
size_bound = -size_bound;
size_bound += 50;
+ if (size_bound > bufsize)
+ /* This is certainly enough that it doesn't matter
+ to lose the rest. */
+ size_bound = bufsize + 100;
+
/* Make sure we have that much. */
if (size_bound > size_allocated)
{
@@ -125,7 +130,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case 'o':
case 'x':
if (cnt == nargs)
- error ("not enough arguments for format string");
+ error ("Not enough arguments for format string");
if (sizeof (int) == sizeof (EMACS_INT))
;
else if (sizeof (long) == sizeof (EMACS_INT))