This changes nothing apart from that the code looks similar to other
places.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
.platform = "riscv",
.personality = PER_LINUX,
},
+
+ // The end
+ { NULL },
};
static const struct pakfire_arch* pakfire_arch_find(const char* name) {
- const size_t length = sizeof(PAKFIRE_ARCHES) / sizeof(*PAKFIRE_ARCHES);
-
- for (unsigned int i = 0; i < length; i++) {
- const struct pakfire_arch* arch = &PAKFIRE_ARCHES[i];
-
+ for (const struct pakfire_arch* arch = PAKFIRE_ARCHES; arch->name; arch++) {
if (strcmp(arch->name, name) == 0)
return arch;
}