diff --git a/WINGs/string.c b/WINGs/string.c index 4db99813..8403d625 100644 --- a/WINGs/string.c +++ b/WINGs/string.c @@ -78,19 +78,17 @@ char *wtokennext(char *word, char **next) } } - if (*ret == 0) - t = NULL; - else - t = wstrdup(ret); - - wfree(ret); + if (*ret == 0) { + wfree(ret); + ret = NULL; + } if (ctype == PRC_EOS) *next = NULL; else *next = ptr; - return t; + return ret; } /* separate a string in tokens, taking " and ' into account */