check for fgets return value

This commit is contained in:
Hinko Kocevar
2025-02-23 11:32:25 +01:00
committed by Andrew Johnson
parent b8e70783d8
commit 7449a947ed

View File

@@ -60,7 +60,9 @@ MAIN(readlineTest)
do {
// expected strings are always single line strings
fgets(line_expect, 499, fp_expect);
if (! fgets(line_expect, 499, fp_expect)) {
testAbort("failed to read an expected line");
}
icin = 0;
while ((c = line_expect[icin]) && isspace(c)) {
icin++;