Fix C std23 related warnings with new glibc.

C standard library functions now preserves qualifiers passed
to some functions. In case of strchr() if the passed argument is
const qualified also the returned value is const qualified. Similarly
if the passed argument is not const qualified neither is the return
value.

This patch makes libcryptsetup compliant with the change and should
be backward compatible with older std libraries.

Thanks Vojta Trefny for heads-up.
This commit is contained in:
Ondrej Kozina
2025-12-02 11:07:04 +01:00
parent f1ba606c28
commit a07c8a556c
5 changed files with 12 additions and 8 deletions

View File

@@ -299,7 +299,8 @@ const char *key_type_name(key_type_t type)
key_type_t keyring_type_and_name(const char *key_name, const char **name)
{
char type[16], *name_tmp;
const char *name_tmp;
char type[16];
size_t type_len;
if (!key_name || key_name[0] != '%')