Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/slave tests/libcurses: format misleading...



details:   https://anonhg.NetBSD.org/src/rev/ee445a66b171
branches:  trunk
changeset: 959393:ee445a66b171
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Feb 12 21:29:54 2021 +0000

description:
tests/libcurses: format misleading do-while loop

diffstat:

 tests/lib/libcurses/slave/slave.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 9184252b5919 -r ee445a66b171 tests/lib/libcurses/slave/slave.c
--- a/tests/lib/libcurses/slave/slave.c Fri Feb 12 21:29:03 2021 +0000
+++ b/tests/lib/libcurses/slave/slave.c Fri Feb 12 21:29:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: slave.c,v 1.10 2021/02/09 20:42:31 rillig Exp $        */
+/*     $NetBSD: slave.c,v 1.11 2021/02/12 21:29:54 rillig Exp $        */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -64,7 +64,7 @@
        if ((cmdbuf = malloc(maxlen)) == NULL)
                err(1, "slave cmdbuf malloc failed");
 
-       while (1) {
+       for (;;) {
                if (read(cmdpipe[READ_PIPE], &type, sizeof(int)) < 0)
                        err(1, "slave command type read failed");
 
@@ -139,8 +139,7 @@
 
                                argslen++;
                        }
-               }
-               while (len >= 0);
+               } while (len >= 0);
 
                command_execute(cmdbuf, argslen, args);
 



Home | Main Index | Thread Index | Old Index