Introduce crypt_strcmp function (allows NULL).

This commit is contained in:
Ondrej Kozina
2019-07-30 14:38:51 +02:00
parent b79086b3e9
commit b216a6a30e
3 changed files with 15 additions and 14 deletions

View File

@@ -334,3 +334,13 @@ bool crypt_string_in(const char *str, char **list, size_t list_size)
return false;
}
/* compare two strings (allows NULL values) */
int crypt_strcmp(const char *a, const char *b)
{
if (!a && !b)
return 0;
else if (!a || !b)
return 1;
return strcmp(a, b);
}