Check return code from fgets to silence warnings.