reopen should return NULL when oflags is less than 0, not equal to 0.
Because negative value is returned on failure of lib_mode2offlags which converts the mode string into file open mode flag.
This commit is contained in:
parent
d9f58fad39
commit
30dbae2dbe
@ -113,7 +113,7 @@ FAR FILE *freopen(FAR const char *path, FAR const char *mode,
|
||||
/* Convert the mode string into standard file open mode flags. */
|
||||
|
||||
oflags = lib_mode2oflags(mode);
|
||||
if (oflags == 0)
|
||||
if (oflags < 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user