[git commit] klogd: code shrink
Denys Vlasenko
vda.linux at googlemail.com
Tue Jul 31 14:50:26 UTC 2018
commit: https://git.busybox.net/busybox/commit/?id=c16ae469ef132d7250a509ef5ccf3420e2fc567f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
function old new delta
klogd_main 511 486 -25
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
sysklogd/klogd.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index a1552ed13..25ddf3172 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -275,10 +275,13 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
priority = LOG_INFO;
if (*start == '<') {
start++;
- if (*start)
- priority = strtoul(start, &start, 10);
- if (*start == '>')
- start++;
+ if (*start) {
+ char *end;
+ priority = strtoul(start, &end, 10);
+ if (*end == '>')
+ end++;
+ start = end;
+ }
}
/* Log (only non-empty lines) */
if (*start)
More information about the busybox-cvs
mailing list