diff --git a/src/keyboard.c b/src/keyboard.c index 99f886821e2..101a6f3a78e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11116,8 +11116,8 @@ the command loop or by `read-key-sequence'. The value is always a vector. */) (void) { - return Fvector (this_command_key_count - - this_single_command_key_start, + ptrdiff_t nkeys = this_command_key_count - this_single_command_key_start; + return Fvector (nkeys < 0 ? 0 : nkeys, (XVECTOR (this_command_keys)->contents + this_single_command_key_start)); }