Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(consume_chars): Rewrite to avoid calculating an address outside buffer.
(Ffind_operation_coding_system): NATNUMP can eval its arg twice.
+ Don't access memory outside of the args array.
(Fdefine_coding_system_internal): Check for charset-id overflow.
(ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
result of ENCODE_CHAR.
if (!SYMBOLP (operation)
|| (target_idx = Fget (operation, Qtarget_idx), !NATNUMP (target_idx)))
error ("Invalid first argument");
- if (nargs < 1 + XFASTINT (target_idx))
+ if (nargs <= 1 + XFASTINT (target_idx))
error ("Too few arguments for operation `%s'",
SDATA (SYMBOL_NAME (operation)));
target = args[XFASTINT (target_idx) + 1];