Commit a14e1568 authored by Paul Eggert's avatar Paul Eggert

* character.c (Funibyte_string): Use CHECK_RANGED_INTEGER instead.

parent 0fd11aa5
......@@ -106,7 +106,7 @@
(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)
......
......@@ -924,7 +924,6 @@ usage: (unibyte-string &rest BYTES) */)
(ptrdiff_t n, Lisp_Object *args)
{
ptrdiff_t i;
int c;
unsigned char *buf, *p;
Lisp_Object str;
USE_SAFE_ALLOCA;
......@@ -934,11 +933,8 @@ usage: (unibyte-string &rest BYTES) */)
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);
......
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