diff options
| author | Richard M. Stallman | 2002-10-26 22:52:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-10-26 22:52:36 +0000 |
| commit | f98176d2142e77ffd8c3564a074b1c0384ae55d1 (patch) | |
| tree | c75b6b9e50bc2446f8959a1ca6bfbf2cafa7f5f0 /src | |
| parent | 5a6f4c958f2e89f6b7ebaec916f7dededd921b9c (diff) | |
| download | emacs-f98176d2142e77ffd8c3564a074b1c0384ae55d1.tar.gz emacs-f98176d2142e77ffd8c3564a074b1c0384ae55d1.zip | |
(Fformat): Detect invalid format letters for floats.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c index 3b71d592bd1..51cf0c0b789 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3259,7 +3259,12 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3259 | else if (FLOATP (args[n]) && *format != 's') | 3259 | else if (FLOATP (args[n]) && *format != 's') |
| 3260 | { | 3260 | { |
| 3261 | if (! (*format == 'e' || *format == 'f' || *format == 'g')) | 3261 | if (! (*format == 'e' || *format == 'f' || *format == 'g')) |
| 3262 | args[n] = Ftruncate (args[n], Qnil); | 3262 | { |
| 3263 | if (*format != 'd' && *format != 'o' && *format != 'x' | ||
| 3264 | && *format != 'i' && *format != 'X' && *format != 'c') | ||
| 3265 | error ("Invalid format operation %%%c", *format); | ||
| 3266 | args[n] = Ftruncate (args[n], Qnil); | ||
| 3267 | } | ||
| 3263 | 3268 | ||
| 3264 | /* Note that we're using sprintf to print floats, | 3269 | /* Note that we're using sprintf to print floats, |
| 3265 | so we have to take into account what that function | 3270 | so we have to take into account what that function |