Phoenix-RTOS: Add checking EOF in getmntent().
This commit is contained in:
parent
cd169e629a
commit
0601c03109
@ -47,7 +47,7 @@ struct mntent *getmntent_r(FILE *fp, struct mntent *result, char *buffer, int bu
|
|||||||
|
|
||||||
buff_ptr = buffer;
|
buff_ptr = buffer;
|
||||||
|
|
||||||
if (getline(&line, &size, fp) == -1) {
|
if (getline(&line, &size, fp) == -1 || feof(fp)) {
|
||||||
free(line);
|
free(line);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user