From e9cf02e428d7be2abcd20a3abbf0cf7d42220655 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 13 Oct 2026 21:11:20 +0200 Subject: [PATCH] fix: flip decrement/increment on comparison - this prevents wrapping size_t below 0 --- src/msh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }