chiark / gitweb /
journalctl: show systemd messages about unit for -u
[elogind.git] / src / journal / test-journal-syslog.c
index 3ae8633f22446abb0b789c7df6aa2db18c9eb290..895975caa5b52624a0a652a4f810d954f2d8923d 100644 (file)
 static void test_syslog_parse_identifier(const char* str,
                                          const char *ident, const char*pid, int ret) {
         const char *buf = str;
-        char *ident2 = NULL, *pid2 = NULL;
+        char _cleanup_free_ *ident2 = NULL, *pid2 = NULL;
         int ret2;
 
         ret2 = syslog_parse_identifier(&buf, &ident2, &pid2);
 
         assert(ret == ret2);
-        assert(ident==ident2 || !strcmp(ident, ident2));
-        assert(pid==pid2 || !strcmp(pid, pid2));
+        assert(ident==ident2 || streq(ident, ident2));
+        assert(pid==pid2 || streq(pid, pid2));
 }
 
 int main(void) {