summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/filter.c b/lib/filter.c
index 204eac1..ad1b937 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -57,8 +57,8 @@ static char* _bmFilterTokenize(bmMenu *menu, char ***outTokv, unsigned int *outT
size_t pos = 0, next;
unsigned int tokc = 0, tokn = 0;
char *s = buffer, **tmp = NULL;
- while ((pos = _bmStripToken(s, " ", &next)) > 0) {
- if (++tokc > tokn && !(tmp = realloc(tmp, ++tokn * sizeof(char*))))
+ for (; (pos = _bmStripToken(s, " ", &next)) > 0; tokv = tmp) {
+ if (++tokc > tokn && !(tmp = realloc(tokv, ++tokn * sizeof(char*))))
goto fail;
tmp[tokc - 1] = s;