fix: flip decrement/increment on comparison
- this prevents wrapping size_t below 0
This commit is contained in:
@@ -484,7 +484,7 @@ int main(int argc, char** argv) {
|
|||||||
fprintf(historyfile, "%s\n", line);
|
fprintf(historyfile, "%s\n", line);
|
||||||
fflush(historyfile);
|
fflush(historyfile);
|
||||||
|
|
||||||
while (tokenworkcapacity < linelen - 1) {
|
while (tokenworkcapacity + 1 < linelen) {
|
||||||
tokenworkcapacity *= 2;
|
tokenworkcapacity *= 2;
|
||||||
tokenwork = realloc(tokenwork, tokenworkcapacity);
|
tokenwork = realloc(tokenwork, tokenworkcapacity);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user