From b567004b4b43f9b0d88aa1f0b15698eae8f15836 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 7 Jun 2024 08:37:39 +0200 Subject: global: improve const correctness when assigning string constants We're about to enable `-Wwrite-strings`, which changes the type of string constants to `const char[]`. Fix various sites where we assign such constants to non-const variables. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/helper/test-regex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/helper/test-regex.c') diff --git a/t/helper/test-regex.c b/t/helper/test-regex.c index 80042eafc2..366bd70976 100644 --- a/t/helper/test-regex.c +++ b/t/helper/test-regex.c @@ -20,8 +20,8 @@ static struct reg_flag reg_flags[] = { static int test_regex_bug(void) { - char *pat = "[^={} \t]+"; - char *str = "={}\nfred"; + const char *pat = "[^={} \t]+"; + const char *str = "={}\nfred"; regex_t r; regmatch_t m[1]; -- cgit v1.2.3