Explorar o código

fix wrong continue in double stacked for loop

Jan Klemkow %!s(int64=5) %!d(string=hai) anos
pai
achega
005d957522
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      scroll.c

+ 2 - 1
scroll.c

@@ -419,7 +419,7 @@ main(int argc, char *argv[])
 						scrollup(rules[i].lines);
 					if (rules[i].event == SCROLL_DOWN)
 						scrolldown(buf, pos, rules[i].lines);
-					continue;
+					goto out;
 				}
 			}
  noevent:
@@ -429,6 +429,7 @@ main(int argc, char *argv[])
 			if (bottom != TAILQ_FIRST(&head))
 				jumpdown(buf, pos);
 		}
+ out:
 		if (pfd[1].revents & POLLIN) {
 			ssize_t n = read(mfd, input, sizeof input);