diff --git a/libs/libc/stdio/lib_fgets.c b/libs/libc/stdio/lib_fgets.c index 0edc2f5b1b..9485e230b2 100644 --- a/libs/libc/stdio/lib_fgets.c +++ b/libs/libc/stdio/lib_fgets.c @@ -57,6 +57,6 @@ char *fgets(FAR char *buf, int buflen, FAR FILE *stream) else { - return lib_fgets(buf, (size_t)buflen, stream, true, false); + return lib_fgets(buf, buflen, stream, true, false); } } diff --git a/libs/libc/stdio/lib_gets.c b/libs/libc/stdio/lib_gets.c index 6ecde396c5..2a25e8fc8a 100644 --- a/libs/libc/stdio/lib_gets.c +++ b/libs/libc/stdio/lib_gets.c @@ -58,5 +58,5 @@ FAR char *gets(FAR char *s) { /* Let lib_fgets() do the heavy lifting */ - return lib_fgets(s, (size_t)INT_MAX, stdin, false, false); + return lib_fgets(s, SIZE_MAX, stdin, false, false); } diff --git a/libs/libc/stdio/lib_gets_s.c b/libs/libc/stdio/lib_gets_s.c index 72aa929fc0..ddcaa8118c 100644 --- a/libs/libc/stdio/lib_gets_s.c +++ b/libs/libc/stdio/lib_gets_s.c @@ -41,7 +41,7 @@ * either a terminating newline or EOF, which it replaces with '\0'. Reads * at most n-1 characters from stdin into the array pointed to by str until * new-line character, end-of-file condition, or read error. The newline - * character, if encountered, is not saved in the arraay. A NUL character + * character, if encountered, is not saved in the array. A NUL character * is written immediately after the last character read into the array, or * to str[0] if no characters were read. * @@ -69,5 +69,5 @@ FAR char *gets_s(FAR char *s, rsize_t n) /* Then let lib_fgets() do the heavy lifting */ - return lib_fgets(s, (size_t)n, stdin, false, true); + return lib_fgets(s, n, stdin, false, true); }