Introduce crypt_string_in internal helper.

And replace custom name_in_list function with new helper.
This commit is contained in:
Ondrej Kozina
2019-06-20 10:54:48 +02:00
committed by Milan Broz
parent 4e19719bdd
commit 011ee5b180
3 changed files with 14 additions and 11 deletions

View File

@@ -323,3 +323,14 @@ int kernel_version(uint64_t *kversion)
return r;
}
bool crypt_string_in(const char *str, char **list, size_t list_size)
{
size_t i;
for (i = 0; *list && i < list_size; i++, list++)
if (!strcmp(str, *list))
return true;
return false;
}