journalctl: explicitly check < 0 for error

This commit is contained in:
Mike Yuan
2024-03-25 23:11:27 +08:00
parent 981b033510
commit d44233503f
+1 -1
View File
@@ -344,7 +344,7 @@ static int help_facilities(void) {
for (int i = 0; i < LOG_NFACILITIES; i++) {
_cleanup_free_ char *t = NULL;
if (log_facility_unshifted_to_string_alloc(i, &t))
if (log_facility_unshifted_to_string_alloc(i, &t) < 0)
return log_oom();
puts(t);
}