From: Sami Kerola Date: Sat, 21 Jan 2012 22:29:02 +0000 (+0100) Subject: tload: remove unnecessary goto X-Git-Tag: v3.3.3~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b9936213963eb2c4c5d02922bbf5eb9ef7e72f6;p=procps-ng tload: remove unnecessary goto Signed-off-by: Sami Kerola --- diff --git a/tload.c b/tload.c index 41ff2868..b21ddd85 100644 --- 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) = ' ';