fixed infinite loop

config files bigger than 512B would cause an infinite loop for
a missing else statement, oops.
xkbcommon
Alessandro Mauri 4 years ago
parent 3bd678d48e
commit 45ea29a760
  1. 4
      hkd.c

@ -749,7 +749,7 @@ void parse_config_file (void)
// First state // First state
case 0: case 0:
// remove whitespaces // remove whitespaces
while (isblank(*bb)) while (isblank(*bb) && *bb)
bb++; bb++;
// get state // get state
switch (*bb) { switch (*bb) {
@ -760,6 +760,8 @@ void parse_config_file (void)
// If it is the end of the last block exit // If it is the end of the last block exit
if (exit_state > 1) if (exit_state > 1)
exit_state = -1; exit_state = -1;
else
exit_state = 1;
break; break;
case '\n': case '\n':
case '#': case '#':

Loading…
Cancel
Save