]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/bootspec: add one more assert
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 May 2022 12:38:16 +0000 (14:38 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 8 May 2022 15:53:56 +0000 (17:53 +0200)
All callers assume that boot_entry_title() always returns something.
It will, as long as it's not called on an uninitialized entry.

src/shared/bootspec.h

index 93fb22e9d406c972ed2f75d690a9eb0f3adb9a8d..56e06f6be9a7a202df21b283103572995d51a7ca 100644 (file)
@@ -92,5 +92,5 @@ int boot_config_select_special_entries(BootConfig *config);
 static inline const char* boot_entry_title(const BootEntry *entry) {
         assert(entry);
 
-        return entry->show_title ?: entry->title ?: entry->id;
+        return ASSERT_PTR(entry->show_title ?: entry->title ?: entry->id);
 }