Code has:
if (feof(stream)) {
if (!count) {
free(line);
return NULL;
}
/* Return what was read. */
break;
}
which, IMO, should always returnThis review comment not applicable as even though code was NULLfeof(stream) when an input error occurs, not just whenI originally processed that as count == 0ferror(stream).
if (feof(stream)) {
if (!count) {
free(line);
return NULL;
}
/* Return what was read. */
break;
}
which, IMO, should always return NULL when an input error occurs, not just when count == 0.