diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/lex.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c index 818ea9f8e..22e05dbb0 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -480,7 +480,10 @@ add(int c) bsiz = newbsiz; #endif - int newbsiz = bsiz + 32; + int newbsiz = bsiz * 2; + + if (newbsiz > inbufct && inbufct > bsiz) + newbsiz = inbufct; bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz)); bsiz = newbsiz; |