diff options
-rw-r--r-- | include/misc.h | 2 | ||||
-rw-r--r-- | os/utils.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/misc.h b/include/misc.h index 17de71041..165d42e85 100644 --- a/include/misc.h +++ b/include/misc.h @@ -246,7 +246,7 @@ padding_for_int32(const int bytes) } -extern char **xstrtokenize(const char *str, const char *separators); +extern const char **xstrtokenize(const char *str, const char *separators); extern void FormatInt64(int64_t num, char *string); extern void FormatUInt64(uint64_t num, char *string); extern void FormatUInt64Hex(uint64_t num, char *string); diff --git a/os/utils.c b/os/utils.c index 608ee6ab0..e81dc5f2d 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1946,10 +1946,10 @@ CheckUserAuthorization(void) * Tokenize a string into a NULL terminated array of strings. Always returns * an allocated array unless an error occurs. */ -char ** +const char ** xstrtokenize(const char *str, const char *separators) { - char **list, **nlist; + const char **list, **nlist; char *tok, *tmp; unsigned num = 0, n; @@ -1977,7 +1977,7 @@ xstrtokenize(const char *str, const char *separators) error: free(tmp); for (n = 0; n < num; n++) - free(list[n]); + free((void *) list[n]); free(list); return NULL; } |