# HG changeset patch # User Karl Heuer # Date 905092821 0 # Node ID 0d3baa5514b7528e881fb333cbdc4447a5150fe5 # Parent 30beacf88b75fc91a265017cf8c777a5063e9faa (Fformat): Detect incomplete format spec at string's end. diff -r 30beacf88b75 -r 0d3baa5514b7 src/editfns.c --- a/src/editfns.c Sun Sep 06 14:31:49 1998 +0000 +++ b/src/editfns.c Sun Sep 06 14:40:21 1998 +0000 @@ -2447,6 +2447,8 @@ 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 @@ { 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. */