[git commit master 1/1] pstree: tiny shrink

Denys Vlasenko vda.linux at googlemail.com
Sun Dec 5 15:05:03 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=c32e626988ab35ba62bbe5b64dc8b86cd9a76bac
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 procps/pstree.c |    5 +++--
 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
-- 
1.7.2.2



More information about the busybox-cvs mailing list