From d04d33167399caa72b215e9f87dd2b7ec872a58d Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Mon, 8 Jun 2026 09:19:36 +0200 Subject: [PATCH] zkey/kmip: Fix 'assignment discards 'const' qualifier' warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix compile warnings like warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] by declaring the variables as const or cast appropriately. Reviewed-by: Finn Callies Signed-off-by: Ingo Franzki Signed-off-by: Jan Höppner --- zkey/kmip/profiles.c | 4 ++-- zkey/kmip/zkey-kmip.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zkey/kmip/profiles.c b/zkey/kmip/profiles.c index 7afc9a36..71de09c7 100644 --- a/zkey/kmip/profiles.c +++ b/zkey/kmip/profiles.c @@ -115,11 +115,11 @@ int profile_read(struct plugin_handle *ph, const char *profile_dir, prof = util_zalloc(sizeof(struct kmip_profile)); - tok = strrchr(profile_file, '/'); + tok = (char *)strrchr(profile_file, '/'); if (tok == NULL) tok = (char *)profile_file; prof->name = util_strdup(tok); - tok = strchr(prof->name, '.'); + tok = (char *)strchr(prof->name, '.'); if (tok != NULL) *tok = 0; diff --git a/zkey/kmip/zkey-kmip.c b/zkey/kmip/zkey-kmip.c index e7b7c739..0038fc98 100644 --- a/zkey/kmip/zkey-kmip.c +++ b/zkey/kmip/zkey-kmip.c @@ -4740,7 +4740,8 @@ out: static char *_parse_label(struct plugin_handle *ph, const char *label, enum kms_key_mode key_mode) { - char *tok, *ret = NULL; + char *ret = NULL; + const char *tok; tok = strchr(label, ':');