diff options
author | Andreas Schwab <schwab@suse.de> | 2015-10-06 11:47:07 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2015-10-06 11:52:06 +0200 |
commit | 0befeb0b7f7492103aa3902146a891fbef9e7d21 (patch) | |
tree | 88cbe19bfa36cb2b829afc024275d8d953e0aa5c /src/cmds.c | |
parent | 25b4572073179c8d6dc980ce2df3db4d96cd692f (diff) | |
download | emacs-0befeb0b7f7492103aa3902146a891fbef9e7d21.tar.gz |
Don't use XFASTINT on a negative number
* src/cmds.c (Fself_insert_command): Don't use XFASTINT on a negative
number. (Bug#21633)
Diffstat (limited to 'src/cmds.c')
-rw-r--r-- | src/cmds.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/cmds.c b/src/cmds.c index ccc68911624..39c5af99f5d 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -307,8 +307,8 @@ At the end, it runs `post-self-insert-hook'. */) { CHECK_NUMBER (n); - if (XFASTINT (n) < 0) - error ("Negative repetition argument %"pI"d", XFASTINT (n)); + if (XINT (n) < 0) + error ("Negative repetition argument %"pI"d", XINT (n)); if (XFASTINT (n) < 2) remove_excessive_undo_boundaries (); @@ -316,14 +316,15 @@ At the end, it runs `post-self-insert-hook'. */) /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (last_command_event)) bitch_at_user (); - else { - int character = translate_char (Vtranslation_table_for_input, - XINT (last_command_event)); - int val = internal_self_insert (character, XFASTINT (n)); - if (val == 2) - nonundocount = 0; - frame_make_pointer_invisible (SELECTED_FRAME ()); - } + else + { + int character = translate_char (Vtranslation_table_for_input, + XINT (last_command_event)); + int val = internal_self_insert (character, XFASTINT (n)); + if (val == 2) + nonundocount = 0; + frame_make_pointer_invisible (SELECTED_FRAME ()); + } return Qnil; } |