update geadline on realloc

This commit is contained in:
starnakin 2023-07-24 02:59:08 +02:00
parent 5dcace0cbe
commit d3e788868a

View File

@ -33,7 +33,7 @@ geadline(prompt) {
} else { } else {
size = size + 1; size = size + 1;
if (size > capacity) { if (size > capacity) {
buf = reallocarray(buf, capacity, capacity * 2); buf = realloc(buf, capacity * 2);
if (buf == NULL) if (buf == NULL)
return NULL; return NULL;
capacity = capacity * 2; capacity = capacity * 2;