DBG(config->ctx, "%s %s\n", modname, param);
- if (streq(modname, "modprobe") && !strncmp(param, "blacklist=", 10)) {
+ if (streq(modname, "modprobe") && strstartswith(param, "blacklist=")) {
for (;;) {
char *t = strsep(&value, ",");
if (t == NULL)
len = sizeof("vermagic=") - 1;
if (i + len >= size)
continue;
- if (strncmp(s, "vermagic=", len) != 0) {
+ if (!strstartswith(s, "vermagic=")) {
i += strlen(s);
continue;
}
name = elf_get_mem(elf, str_off + name_off);
- if (strncmp(name, crc_str, crc_strlen) != 0)
+ if (!strstartswith(name, crc_str))
continue;
count++;
}
}
#undef READV
name = elf_get_mem(elf, str_off + name_off);
- if (strncmp(name, crc_str, crc_strlen) != 0)
+ if (!strstartswith(name, crc_str))
continue;
name += crc_strlen;
prio = strtol(priority, &endptr, 10);
if (endptr[0] == '\0' || isspace(endptr[0]))
return prio;
- if (strncmp(priority, "err", 3) == 0)
+ if (strstartswith(priority, "err"))
return LOG_ERR;
- if (strncmp(priority, "info", 4) == 0)
+ if (strstartswith(priority, "info"))
return LOG_INFO;
- if (strncmp(priority, "debug", 5) == 0)
+ if (strstartswith(priority, "debug"))
return LOG_DEBUG;
return 0;
}