stream_getc: use lib_stream_eof instead of EOF

Will case scanftest break #14778, at " %4c%n" case.
scanf use INT_MAX cause EOF break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen
2024-11-22 22:40:47 +08:00
committed by Xiang Xiao
parent f3213efc7f
commit 3e24aab208
8 changed files with 23 additions and 14 deletions
+5 -5
View File
@@ -180,7 +180,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* No, ungotten characters. Get the next character from the buffer. */
ch = lib_stream_getc(stream);
if (ch == EOF)
if (lib_stream_eof(ch))
{
/* End of file/stream (or perhaps an I/O error) */
@@ -204,7 +204,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */
ch = lib_stream_getc(stream);
if (ch == EOF)
if (lib_stream_eof(ch))
{
/* End of file/stream. Return the escape character now. We will
* return the EOF indication next time.
@@ -233,7 +233,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */
ch = lib_stream_getc(stream);
if (ch == EOF)
if (lib_stream_eof(ch))
{
/* End of file/stream. Return the ESC now; return the following
* characters later.
@@ -281,7 +281,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */
ch = lib_stream_getc(stream);
if (ch == EOF)
if (lib_stream_eof(ch))
{
/* End of file/stream. Return the ESC now; return the following
* characters later.
@@ -314,7 +314,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */
ch = lib_stream_getc(stream);
if (ch == EOF)
if (lib_stream_eof(ch))
{
/* End of file/stream. Return the ESC now; return the following
* characters later.