Skip to content
Snippets Groups Projects
Commit 30dbae2d authored by Gregory Nutt's avatar Gregory Nutt
Browse files

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.
parent d9f58fad
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment