(str_as_unibyte, str_to_unibyte, string_count_byte8)
(string_escape_byte8, Fget_byte):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
- (Funibyte_string): Use CHECK_CHARACTER, not CHECK_NATNUM, to
+ (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
avoid mishandling large integers.
* character.h: Adjust decls to match defn changes elsewhere.
* charset.c (load_charset_map_from_file, find_charsets_in_text)
(ptrdiff_t n, Lisp_Object *args)
{
ptrdiff_t i;
- int c;
unsigned char *buf, *p;
Lisp_Object str;
USE_SAFE_ALLOCA;
for (i = 0; i < n; i++)
{
- CHECK_CHARACTER (args[i]);
- c = XFASTINT (args[i]);
- if (c >= 256)
- args_out_of_range_3 (args[i], make_number (0), make_number (255));
- *p++ = c;
+ CHECK_RANGED_INTEGER (0, args[i], 255);
+ *p++ = XINT (args[i]);
}
str = make_string_from_bytes ((char *) buf, n, p - buf);