mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
5529cba09f
commit
b567004b4b
@@ -113,8 +113,8 @@ static int populate_maildir_list(struct string_list *list, const char *path)
|
||||
DIR *dir;
|
||||
struct dirent *dent;
|
||||
char *name = NULL;
|
||||
char *subs[] = { "cur", "new", NULL };
|
||||
char **sub;
|
||||
const char *subs[] = { "cur", "new", NULL };
|
||||
const char **sub;
|
||||
int ret = -1;
|
||||
|
||||
for (sub = subs; *sub; ++sub) {
|
||||
|
||||
Reference in New Issue
Block a user