diff --git a/src/msh.c b/src/msh.c index 3139531..28a07c1 100644 --- a/src/msh.c +++ b/src/msh.c @@ -484,7 +484,7 @@ int main(int argc, char** argv) { fprintf(historyfile, "%s\n", line); fflush(historyfile); - while (tokenworkcapacity < linelen - 1) { + while (tokenworkcapacity + 1 < linelen) { tokenworkcapacity *= 2; tokenwork = realloc(tokenwork, tokenworkcapacity); }