Commit da09ccce authored by Paul Eggert's avatar Paul Eggert
Browse files

* fns.c (Fstring_to_unibyte): Don't rely on undefined behavior

by passing a long int to a printf format expecting an int.
parent 1e973bc7
......@@ -2,6 +2,9 @@
 
Fix more problems found by GCC 4.6.0's static checks.
 
* fns.c (Fstring_to_unibyte): Don't rely on undefined behavior
by passing a long int to a printf format expecting an int.
* lisp.h (message, message_nolog, doprint, error, verror, fatal):
Mark as printf-like functions.
 
......@@ -1076,7 +1076,10 @@ an error is signaled. */)
EMACS_INT converted = str_to_unibyte (SDATA (string), str, chars, 0);
if (converted < chars)
error ("Can't convert the %dth character to unibyte", converted);
{
long lconverted = converted;
error ("Can't convert the %ldth character to unibyte", lconverted);
}
string = make_unibyte_string ((char *) str, chars);
xfree (str);
}
......
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