mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Introduce crypt_string_in internal helper.
And replace custom name_in_list function with new helper.
This commit is contained in:
committed by
Milan Broz
parent
4e19719bdd
commit
011ee5b180
11
lib/utils.c
11
lib/utils.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user