mirror of
https://github.com/apache/nuttx.git
synced 2026-08-09 22:45:08 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue