From 084b82e712ab06eb00935b21192b87dae617d076 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 7 Aug 1995 17:52:16 +0000 Subject: (doprnt): Don't let size_bound be gigantic. Fix error message. --- src/doprnt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/doprnt.c') diff --git a/src/doprnt.c b/src/doprnt.c index 24eea1e70f6..63f724cf7a7 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)) -- cgit v1.2.1