]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/worm.c
ncurses 6.3 - patch 20221224
[ncurses.git] / test / worm.c
index aca96c6f3127ee120d1a84bcfbdacfa86a32a028..7c4842e4004f3bc772080e9dd9f2607402691e60 100644 (file)
@@ -53,7 +53,7 @@
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.88 2022/12/04 00:40:11 tom Exp $
+  $Id: worm.c,v 1.89 2022/12/24 20:46:49 tom Exp $
 */
 
 #include <test.priv.h>
 */
 
 #include <test.priv.h>
@@ -368,7 +368,11 @@ start_worm(void *arg)
     unsigned long compare = 0;
     Trace(("start_worm"));
     while (!quit_worm((int) (((struct worm *) arg) - worm))) {
     unsigned long compare = 0;
     Trace(("start_worm"));
     while (!quit_worm((int) (((struct worm *) arg) - worm))) {
-       while (compare < sequence) {
+       for (;;) {
+           bool done = FALSE;
+           Locked(done = (compare >= sequence));
+           if (done)
+               break;
            ++compare;
            USING_WINDOW2(stdscr, draw_worm, arg);
        }
            ++compare;
            USING_WINDOW2(stdscr, draw_worm, arg);
        }