From e6c3da2065ac72cc4e1a2bef22d367cd75401892 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 23 Apr 2011 13:33:28 +0300 Subject: Fix doprnt so it could be used safely in `verror'. (Bug#8435) src/doprnt.c: Include limits.h. (SIZE_MAX): New macro. (doprnt): Return a size_t value. 2nd arg is now size_t. Many local variables are now size_t instead of int or unsigned. Improve overflow protection. Support `l' modifier for integer conversions. Support %l conversion. Don't assume an EMACS_INT argument for integer conversions and for %c. src/lisp.h (doprnt): Restore prototype. src/makefile.w32-in ($(BLD)/callint.$(O)): Depend on $(SRC)/character.h. src/Makefile.in (base_obj): Add back doprnt.o. src/deps.mk (doprnt.o): Add back prerequisites. (callint.o): Depend on character.h. src/eval.c (internal_lisp_condition_case): Include the handler representation in the error message. (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug when breaking from the loop. src/xdisp.c (vmessage): Call doprnt instead of vsnprintf. src/callint.c (Fcall_interactively): When displaying error message about invalid control letter, pass the character's codepoint, not a pointer to its multibyte form. Improve display of the character in octal and display also its hex code. src/character.c (char_string): Use %x to display the (unsigned) codepoint of an invalid character, to avoid displaying a bogus negative value. src/font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to `error', not SYMBOL_NAME itself. src/coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for character arguments to `error'. src/charset.c (check_iso_charset_parameter): Fix incorrect argument to `error' in error message about FINAL_CHAR argument. Make sure FINAL_CHAR is a character, and use %c when it is passed as argument to `error'. --- src/ChangeLog | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/ChangeLog') diff --git a/src/ChangeLog b/src/ChangeLog index 0067163edbf..831fb6afcd0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,51 @@ +2011-04-23 Eli Zaretskii + + Fix doprnt so it could be used again safely in `verror'. (Bug#8435) + * doprnt.c: Include limits.h. + (SIZE_MAX): New macro. + (doprnt): Return a size_t value. 2nd arg is now size_t. Many + local variables are now size_t instead of int or unsigned. + Improve overflow protection. Support `l' modifier for integer + conversions. Support %l conversion. Don't assume an EMACS_INT + argument for integer conversions and for %c. + + * lisp.h (doprnt): Restore prototype. + + * makefile.w32-in ($(BLD)/callint.$(O)): Depend on + $(SRC)/character.h. + + * Makefile.in (base_obj): Add back doprnt.o. + + * deps.mk (doprnt.o): Add back prerequisites. + (callint.o): Depend on character.h. + + * eval.c (internal_lisp_condition_case): Include the handler + representation in the error message. + (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug + when breaking from the loop. + + * xdisp.c (vmessage): Call doprnt instead of vsnprintf. + + * callint.c (Fcall_interactively): When displaying error message + about invalid control letter, pass the character's codepoint, not + a pointer to its multibyte form. Improve display of the character + in octal and display also its hex code. + + * character.c (char_string): Use %x to display the (unsigned) + codepoint of an invalid character, to avoid displaying a bogus + negative value. + + * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to + `error', not SYMBOL_NAME itself. + + * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for + character arguments to `error'. + + * charset.c (check_iso_charset_parameter): Fix incorrect argument + to `error' in error message about FINAL_CHAR argument. Make sure + FINAL_CHAR is a character, and use %c when it is passed as + argument to `error'. + 2011-04-23 Eli Zaretskii * s/ms-w32.h (localtime): Redirect to sys_localtime. -- cgit v1.2.1