test-journal-syslog: initialize variable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 25 Sep 2018 09:34:52 +0000 (11:34 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 25 Sep 2018 09:34:52 +0000 (11:34 +0200)
The *priority argument to syslog_parse_priority() needs to be initialized
if the last argument (with_facility) is false.

CID #1394690.

src/journal/test-journal-syslog.c

index 415b9d2..45be7e5 100644 (file)
@@ -22,7 +22,7 @@ static void test_syslog_parse_identifier(const char *str,
 
 static void test_syslog_parse_priority(const char *str, int priority, int ret) {
         const char *buf = str;
-        int priority2, ret2;
+        int priority2 = 0, ret2;
 
         ret2 = syslog_parse_priority(&buf, &priority2, false);