Commit d0339a5c authored by Keith Packard's avatar Keith Packard

os: xstrtokenize takes and returns const char * now

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
parent c608560d
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment