From: Karl Heuer Date: Sun, 6 Sep 1998 14:40:21 +0000 (+0000) Subject: (Fformat): Detect incomplete format spec at string's end. X-Git-Tag: emacs-20.4~1752 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bf6ab66c9adfcc1136f6ef343185039d531d5b6d;p=emacs.git (Fformat): Detect incomplete format spec at string's end. --- diff --git a/src/editfns.c b/src/editfns.c index f31c7f66e15..31324cfde6f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2447,6 +2447,8 @@ Use %% to put a single % into the output.") if (format - this_format_start + 1 > longest_format) longest_format = format - this_format_start + 1; + if (format == end) + error ("Format string ends in middle of format specifier"); if (*format == '%') format++; else if (++n >= nargs) @@ -2478,7 +2480,7 @@ Use %% to put a single % into the output.") { string: if (*format != 's' && *format != 'S') - error ("format specifier doesn't match argument type"); + error ("Format specifier doesn't match argument type"); thissize = CONVERTED_BYTE_SIZE (multibyte, args[n]); } /* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */