diff --git a/cmdline/support.c b/cmdline/support.c index 5936c048..d6bc0dc8 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -886,7 +886,7 @@ unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* d /* skip initial delimiters */ str += strspn(str, delimiters); - while (*str != 0 || mac == split_max) { + while (*str != 0 && mac < split_max) { /* start of the token */ split_map[mac] = str; ++mac;