libc/gets: Remove the unnecessary cast

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-11-18 02:12:01 +08:00 committed by Alan Carvalho de Assis
parent b5f6dcb523
commit 5da9dbe57a
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}