tree-wide: replace string functions with fundamental functions
This commit is contained in:
@@ -453,13 +453,13 @@ int efi_get_boot_options(uint16_t **ret_options) {
|
||||
FOREACH_DIRENT(de, dir, return -errno) {
|
||||
int id;
|
||||
|
||||
if (strncmp(de->d_name, "Boot", 4) != 0)
|
||||
if (!startswith(de->d_name, "Boot"))
|
||||
continue;
|
||||
|
||||
if (strlen(de->d_name) != 45)
|
||||
continue;
|
||||
|
||||
if (strcmp(de->d_name + 8, EFI_GLOBAL_VARIABLE_STR("")) != 0) /* generate variable suffix using macro */
|
||||
if (!streq(de->d_name + 8, EFI_GLOBAL_VARIABLE_STR(""))) /* generate variable suffix using macro */
|
||||
continue;
|
||||
|
||||
id = boot_id_hex(de->d_name + 4);
|
||||
|
||||
@@ -232,23 +232,21 @@ int fstab_filter_options(
|
||||
}
|
||||
|
||||
NULSTR_FOREACH(name, names) {
|
||||
if (end < word + strlen(name))
|
||||
continue;
|
||||
if (!strneq(word, name, strlen(name)))
|
||||
x = startswith(word, name);
|
||||
if (!x || x > end)
|
||||
continue;
|
||||
|
||||
/* We know that the string is NUL terminated, so *x is valid */
|
||||
x = word + strlen(name);
|
||||
if (IN_SET(*x, '\0', '=', ',')) {
|
||||
namefound = name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*end)
|
||||
word = end + 1;
|
||||
else
|
||||
if (*end == '\0')
|
||||
break;
|
||||
|
||||
word = end + 1;
|
||||
}
|
||||
|
||||
answer:
|
||||
|
||||
Reference in New Issue
Block a user