From a74114fe34285f587a27562c6938db42142fa6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 3 Jan 2022 12:19:00 +0100 Subject: [PATCH] Declare variable for string literal const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit newgidmap.c:87:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 87 | policy = "deny\n"; | ^ --- src/newgidmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/newgidmap.c b/src/newgidmap.c index 05996eaa..5b42431b 100644 --- a/src/newgidmap.c +++ b/src/newgidmap.c @@ -76,7 +76,8 @@ static void usage(void) static void write_setgroups(int proc_dir_fd, bool allow_setgroups) { int setgroups_fd; - char *policy, policy_buffer[4096]; + const char *policy; + char policy_buffer[4096]; /* * Default is "deny", and any "allow" will out-rank a "deny". We don't