瀏覽代碼

klogd: code shrink

function                                             old     new   delta
klogd_main                                           511     486     -25

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Denys Vlasenko 5 年之前
父節點
當前提交
c16ae469ef
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      sysklogd/klogd.c

+ 7 - 4
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)