summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-12-05 15:05:03 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-12-05 15:05:03 (GMT)
commitc32e626988ab35ba62bbe5b64dc8b86cd9a76bac (patch)
tree89962617f9663cf546967f1612d916392685fa9a
parente48e6f85bf1966cb3a6350f5c2276ca73251a2f6 (diff)
downloadbusybox-c32e626988ab35ba62bbe5b64dc8b86cd9a76bac.tar.gz
busybox-c32e626988ab35ba62bbe5b64dc8b86cd9a76bac.tar.bz2
pstree: tiny shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/pstree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/procps/pstree.c b/procps/pstree.c
index 25fb65d..7e12773 100644
--- a/procps/pstree.c
+++ b/procps/pstree.c
@@ -111,10 +111,11 @@ static void maybe_free_buffers(void)
static void out_char(char c)
{
G.cur_x++;
+ if (G.cur_x > G.output_width)
+ return;
if (G.cur_x == G.output_width)
c = '+';
- if (G.cur_x <= G.output_width)
- putchar(c);
+ putchar(c);
}
/* NB: this function is never called with "bad" chars