Mercurial > emacs
diff src/editfns.c @ 48020:7ac7ca5ac550
(Fformat): Detect invalid format letters for floats.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 26 Oct 2002 22:52:36 +0000 |
| parents | da8405c812f2 |
| children | 2a8ba962e34d |
line wrap: on
line diff
--- a/src/editfns.c Sat Oct 26 22:49:46 2002 +0000 +++ b/src/editfns.c Sat Oct 26 22:52:36 2002 +0000 @@ -3259,7 +3259,12 @@ else if (FLOATP (args[n]) && *format != 's') { if (! (*format == 'e' || *format == 'f' || *format == 'g')) - args[n] = Ftruncate (args[n], Qnil); + { + if (*format != 'd' && *format != 'o' && *format != 'x' + && *format != 'i' && *format != 'X' && *format != 'c') + error ("Invalid format operation %%%c", *format); + args[n] = Ftruncate (args[n], Qnil); + } /* Note that we're using sprintf to print floats, so we have to take into account what that function
