Revert "os: xstrtokenize takes and returns const char * now"

This reverts commit d0339a5c66.

seriously, what the fuck? Are we making xstrdup() return a const char now too?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2014-01-30 08:52:32 +10:00
parent ce3df579e3
commit 675f215af2
2 changed files with 4 additions and 4 deletions

View File

@ -246,7 +246,7 @@ padding_for_int32(const int bytes)
} }
extern const char **xstrtokenize(const char *str, const char *separators); extern char **xstrtokenize(const char *str, const char *separators);
extern void FormatInt64(int64_t num, char *string); extern void FormatInt64(int64_t num, char *string);
extern void FormatUInt64(uint64_t num, char *string); extern void FormatUInt64(uint64_t num, char *string);
extern void FormatUInt64Hex(uint64_t num, char *string); extern void FormatUInt64Hex(uint64_t num, char *string);

View File

@ -1973,10 +1973,10 @@ CheckUserAuthorization(void)
* Tokenize a string into a NULL terminated array of strings. Always returns * Tokenize a string into a NULL terminated array of strings. Always returns
* an allocated array unless an error occurs. * an allocated array unless an error occurs.
*/ */
const char ** char **
xstrtokenize(const char *str, const char *separators) xstrtokenize(const char *str, const char *separators)
{ {
const char **list, **nlist; char **list, **nlist;
char *tok, *tmp; char *tok, *tmp;
unsigned num = 0, n; unsigned num = 0, n;
@ -2004,7 +2004,7 @@ xstrtokenize(const char *str, const char *separators)
error: error:
free(tmp); free(tmp);
for (n = 0; n < num; n++) for (n = 0; n < num; n++)
free((void *) list[n]); free(list[n]);
free(list); free(list);
return NULL; return NULL;
} }