]> granicus.if.org Git - procps-ng/commitdiff
tload: remove unnecessary goto
authorSami Kerola <kerolasa@iki.fi>
Sat, 21 Jan 2012 22:29:02 +0000 (23:29 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 21 Jan 2012 22:29:02 +0000 (23:29 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tload.c

diff --git a/tload.c b/tload.c
index 41ff2868db37b31dd56a85756c6f46bef5d1067c..b21ddd8576b007a935afc108568f55b60f32abff 100644 (file)
--- a/tload.c
+++ b/tload.c
@@ -151,17 +151,21 @@ int main(int argc, char **argv)
 
                loadavg(&av[0], &av[1], &av[2]);
 
- repeat:
-               lines = av[0] * scale_fact;
-               row = nrows - 1;
-
-               while (--lines >= 0) {
-                       *(screen + row * ncols + col) = '*';
-                       if (--row < 0) {
-                               scale_fact /= 2.0;
-                               goto repeat;
+               while (1) {
+                       lines = av[0] * scale_fact;
+                       row = nrows - 1;
+
+                       while (0 <= --lines) {
+                               *(screen + row * ncols + col) = '*';
+                               if (--row < 0) {
+                                       scale_fact /= 2.0;
+                                       break;
+                               }
                        }
+                       if (0 < row)
+                               break;
                }
+
                while (row >= 0)
                        *(screen + row-- * ncols + col) = ' ';