# HG changeset patch # User Karl Heuer # Date 764580008 0 # Node ID d0f6a386b7cb5cba2e86fc8335e0af5d1bf11994 # Parent ab9f20a3f502e898e4d349c072994c69dcfbeb5f (Fformat): Validate number and type of arguments. diff -r ab9f20a3f502 -r d0f6a386b7cb src/editfns.c --- a/src/editfns.c Fri Mar 25 06:12:40 1994 +0000 +++ b/src/editfns.c Fri Mar 25 07:20:08 1994 +0000 @@ -1463,7 +1463,7 @@ if (*format == '%') format++; else if (++n >= nargs) - ; + error ("format string wants too many arguments"); else if (*format == 'S') { /* For `S', prin1 the argument and then treat like a string. */ @@ -1480,6 +1480,8 @@ else if (XTYPE (args[n]) == Lisp_String) { string: + if (*format != 's' && *format != 'S') + error ("format specifier doesn't match argument type"); total += XSTRING (args[n])->size; } /* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */