chiark / gitweb /
sd-journal: change check to assert
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 Oct 2014 02:51:35 +0000 (22:51 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 Oct 2014 02:51:35 +0000 (22:51 -0400)
As of 0f99f74a14 'sd-journal: verify that object start with the field
name' this condition should never happen.

src/journal/journalctl.c

index feb53bd203a3fc55194fa6fdd9e79b3dc7f7c79f..7f4bc3229cb5a60fdfdd4732474263e99ba8678b 100644 (file)
@@ -838,8 +838,7 @@ static int list_boots(sd_journal *j) {
                 return r;
 
         SD_JOURNAL_FOREACH_UNIQUE(j, data, length) {
-                if (length < strlen("_BOOT_ID="))
-                        continue;
+                assert(startswith(data, "_BOOT_ID="));
 
                 if (!GREEDY_REALLOC(all_ids, allocated, count + 1))
                         return log_oom();