Commit 315bac46 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

events/keyevents: zero cur_bb/cur_kb on each iteration

previously, a button/key definition with an invalid action name would assign
the specified key to the most recent valid action. E.g. "zoom_in 4\ninvalid 5"
wuold assign button 5 to zoom_in.
parent f13f1c3b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ void init_buttonbindings(void)
	while (fgets(line, sizeof(line), conf)) {
		*action = '\0';
		*button = '\0';
		cur_bb = NULL;

		read = sscanf(line, "%31s %7s\n", (char *) &action, (char *) &button);

+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ void init_keyevents(void) {
		*k1 = '\0';
		*k2 = '\0';
		*k3 = '\0';
		cur_kb = NULL;

		read = sscanf(line, "%31s %31s %31s %31s\n",
			(char *) &action, (char *) &k1, (char* ) &k2, (char *) &k3);