aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-rot13-filter.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-07 08:37:39 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-07 10:30:48 -0700
commitb567004b4b43f9b0d88aa1f0b15698eae8f15836 (patch)
treefc7b75831c1eb79a89c0196fbb78bd6b7d09d0b1 /t/helper/test-rot13-filter.c
parentMerge branch 'ps/leakfixes' into ps/no-writable-strings (diff)
downloadgit-b567004b4b43f9b0d88aa1f0b15698eae8f15836.tar.gz
git-b567004b4b43f9b0d88aa1f0b15698eae8f15836.zip
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-rot13-filter.c')
-rw-r--r--t/helper/test-rot13-filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/helper/test-rot13-filter.c b/t/helper/test-rot13-filter.c
index f8d564c622..7e1d9e0ee4 100644
--- a/t/helper/test-rot13-filter.c
+++ b/t/helper/test-rot13-filter.c
@@ -136,7 +136,7 @@ static void free_delay_entries(void)
strmap_clear(&delay, 0);
}
-static void add_delay_entry(char *pathname, int count, int requested)
+static void add_delay_entry(const char *pathname, int count, int requested)
{
struct delay_entry *entry = xcalloc(1, sizeof(*entry));
entry->count = count;
@@ -189,7 +189,8 @@ static void reply_list_available_blobs_cmd(void)
static void command_loop(void)
{
for (;;) {
- char *buf, *output;
+ char *buf;
+ const char *output;
char *pathname;
struct delay_entry *entry;
struct strbuf input = STRBUF_INIT;