diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-15 15:28:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-15 15:28:49 +0100 |
commit | 99c71c9e800d51aa52d7bd592e8071341013a628 (patch) | |
tree | 091295e6a7afa05755bb5dd00d1ee4d3c1e9ecf5 | |
parent | e4de8c631644be5e96711462763bf16491dda54f (diff) | |
download | busybox-w32-99c71c9e800d51aa52d7bd592e8071341013a628.tar.gz busybox-w32-99c71c9e800d51aa52d7bd592e8071341013a628.tar.bz2 busybox-w32-99c71c9e800d51aa52d7bd592e8071341013a628.zip |
nmeter: code shrink
function old new delta
put 52 43 -9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | procps/nmeter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c index 0ce6842e7..8fe39c43b 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c | |||
@@ -142,11 +142,11 @@ static void print_outbuf(void) | |||
142 | 142 | ||
143 | static void put(const char *s) | 143 | static void put(const char *s) |
144 | { | 144 | { |
145 | int sz = strlen(s); | 145 | char *p = cur_outbuf; |
146 | if (sz > outbuf + sizeof(outbuf) - cur_outbuf) | 146 | int sz = outbuf + sizeof(outbuf) - p; |
147 | sz = outbuf + sizeof(outbuf) - cur_outbuf; | 147 | while (*s && --sz >= 0) |
148 | memcpy(cur_outbuf, s, sz); | 148 | *p++ = *s++; |
149 | cur_outbuf += sz; | 149 | cur_outbuf = p; |
150 | } | 150 | } |
151 | 151 | ||
152 | static void put_c(char c) | 152 | static void put_c(char c) |