aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-string-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-02 10:13:35 -0700
committerJunio C Hamano <gitster@pobox.com>2023-05-02 10:13:35 -0700
commitd699e27bd487598bc3c5bbf649d866c5274ef8cd (patch)
tree8e9f201a52546742933c5e92648788e5ca5c8795 /t/helper/test-string-list.c
parentMerge branch 'jk/blame-fake-commit-label' (diff)
parentbanned.h: mark `strtok()` and `strtok_r()` as banned (diff)
downloadgit-d699e27bd487598bc3c5bbf649d866c5274ef8cd.tar.gz
git-d699e27bd487598bc3c5bbf649d866c5274ef8cd.zip
Merge branch 'tb/ban-strtok'
Mark strtok() and strtok_r() to be banned. * tb/ban-strtok: banned.h: mark `strtok()` and `strtok_r()` as banned t/helper/test-json-writer.c: avoid using `strtok()` t/helper/test-oidmap.c: avoid using `strtok()` t/helper/test-hashmap.c: avoid using `strtok()` string-list: introduce `string_list_setlen()` string-list: multi-delimiter `string_list_split_in_place()`
Diffstat (limited to 't/helper/test-string-list.c')
-rw-r--r--t/helper/test-string-list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c
index 2123dda85b..63df88575c 100644
--- a/t/helper/test-string-list.c
+++ b/t/helper/test-string-list.c
@@ -62,7 +62,7 @@ int cmd__string_list(int argc, const char **argv)
struct string_list list = STRING_LIST_INIT_NODUP;
int i;
char *s = xstrdup(argv[2]);
- int delim = *argv[3];
+ const char *delim = argv[3];
int maxsplit = atoi(argv[4]);
i = string_list_split_in_place(&list, s, delim, maxsplit);
@@ -111,7 +111,7 @@ int cmd__string_list(int argc, const char **argv)
*/
if (sb.len && sb.buf[sb.len - 1] == '\n')
strbuf_setlen(&sb, sb.len - 1);
- string_list_split_in_place(&list, sb.buf, '\n', -1);
+ string_list_split_in_place(&list, sb.buf, "\n", -1);
string_list_sort(&list);