2 ms·
I think the multiplication should be here: buffer = realloc(buffer, bufsize * sizeof(char)); This makes the code symmetric wrt. the malloc() call. And bet
by amelius 6y ago
I think the multiplication should be here:
buffer = realloc(buffer, bufsize * sizeof(char));
This makes the code symmetric wrt. the malloc() call. And better allows the code to be rewritten when moving to e.g. a wide-character type.