diff --git a/lib/stdio/lib_fgetc.c b/lib/stdio/lib_fgetc.c index 58a199724f6..4e521e8403d 100644 --- a/lib/stdio/lib_fgetc.c +++ b/lib/stdio/lib_fgetc.c @@ -86,10 +86,13 @@ int fgetc(FAR FILE *stream) { - unsigned char c; - if (lib_fread(&c, 1, stream) > 0) + unsigned char ch; + ssize_t ret; + + ret = lib_fread(&ch, 1, stream); + if (ret > 0) { - return c; + return ch; } else { diff --git a/lib/stdio/lib_gets.c b/lib/stdio/lib_gets.c index 33ae48aaabe..20b2906df96 100644 --- a/lib/stdio/lib_gets.c +++ b/lib/stdio/lib_gets.c @@ -99,7 +99,7 @@ FAR char *gets(FAR char *s) { /* gets is ALMOST the same as fgets using stdin and no - * lenght limit (hence, the unsafeness of gets). So let + * length limit (hence, the unsafeness of gets). So let * fgets do most of the work. */