From: Richard M. Stallman Date: Fri, 11 Aug 1995 00:42:28 +0000 (+0000) Subject: (doprnt): Error if %-width is too big. X-Git-Tag: emacs-19.34~3030 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dfb824e8d4b54bfb913a8c4c2080d8a2dec1dbcb;p=emacs.git (doprnt): Error if %-width is too big. --- diff --git a/src/doprnt.c b/src/doprnt.c index 63f724cf7a7..6db0eda1514 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -104,10 +104,8 @@ 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; + if (size_bound > (unsigned) (1 << (INTBITS - 1))) + error ("Format padding to large"); /* Make sure we have that much. */ if (size_bound > size_allocated)