Commit f98176d2 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fformat): Detect invalid format letters for floats.

parent 5a6f4c95
...@@ -3259,7 +3259,12 @@ usage: (format STRING &rest OBJECTS) */) ...@@ -3259,7 +3259,12 @@ usage: (format STRING &rest OBJECTS) */)
else if (FLOATP (args[n]) && *format != 's') else if (FLOATP (args[n]) && *format != 's')
{ {
if (! (*format == 'e' || *format == 'f' || *format == 'g')) 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, /* Note that we're using sprintf to print floats,
so we have to take into account what that function so we have to take into account what that function
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment