summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-10-26 22:52:36 +0000
committerRichard M. Stallman <rms@gnu.org>2002-10-26 22:52:36 +0000
commitf98176d2142e77ffd8c3564a074b1c0384ae55d1 (patch)
treec75b6b9e50bc2446f8959a1ca6bfbf2cafa7f5f0 /src/editfns.c
parent5a6f4c958f2e89f6b7ebaec916f7dededd921b9c (diff)
downloademacs-f98176d2142e77ffd8c3564a074b1c0384ae55d1.tar.gz
(Fformat): Detect invalid format letters for floats.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c7
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) */)
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