summaryrefslogtreecommitdiff
path: root/src/macros.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-04 14:52:59 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-04 14:52:59 -0700
commit86633eab8a77697f6e15aae568868781a5a1023f (patch)
tree22039ff17f96363d7115a8e02c0884010ba75744 /src/macros.c
parent53e9fe90811730f68c4ea246cd8dee8aa22486de (diff)
parent6511acf2570df26e93e15283d593b8e81d217a78 (diff)
downloademacs-86633eab8a77697f6e15aae568868781a5a1023f.tar.gz
emacs-86633eab8a77697f6e15aae568868781a5a1023f.tar.bz2
emacs-86633eab8a77697f6e15aae568868781a5a1023f.zip
sprintf-related integer and memory overflow issues
Fixes: debbugs:9397 debbugs:9412
Diffstat (limited to 'src/macros.c')
-rw-r--r--src/macros.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/macros.c b/src/macros.c
index f6cd3a3ccad..4ecf49834a1 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -35,7 +35,7 @@ static Lisp_Object Qkbd_macro_termination_hook;
This is not bound at each level,
so after an error, it describes the innermost interrupted macro. */
-int executing_kbd_macro_iterations;
+EMACS_INT executing_kbd_macro_iterations;
/* This is the macro that was executing.
This is not bound at each level,
@@ -175,11 +175,11 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
if (XFASTINT (repeat) == 0)
Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
- else
+ else if (XINT (repeat) > 1)
{
XSETINT (repeat, XINT (repeat)-1);
- if (XINT (repeat) > 0)
- Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
+ Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro),
+ repeat, loopfunc);
}
return Qnil;
}
@@ -302,9 +302,9 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
Lisp_Object final;
Lisp_Object tem;
int pdlcount = SPECPDL_INDEX ();
- int repeat = 1;
+ EMACS_INT repeat = 1;
struct gcpro gcpro1, gcpro2;
- int success_count = 0;
+ EMACS_INT success_count = 0;
executing_kbd_macro_iterations = 0;