mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:17:13 +08:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user