mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
stdio/lib_clearerr: Did not clear stream buffer flags in clearerr
Stream buffer flags has a dependency with allocated buffer, and it cannot clear without buffer operation. Change clearerr to keep buffer flags to prevent unexpected buffer operation.
This commit is contained in:
@@ -48,6 +48,6 @@
|
|||||||
|
|
||||||
void clearerr(FAR FILE *stream)
|
void clearerr(FAR FILE *stream)
|
||||||
{
|
{
|
||||||
stream->fs_flags = 0;
|
stream->fs_flags &= (__FS_FLAG_LBF | __FS_FLAG_UBF);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_FILE_STREAM */
|
#endif /* CONFIG_FILE_STREAM */
|
||||||
|
|||||||
Reference in New Issue
Block a user