[Skiboot] [PATCH] return type of strlen from int to size_t

Mukesh Ojha mukesh02 at linux.vnet.ibm.com
Thu Sep 1 21:56:49 AEST 2016


Missed to add Skiboot tag in the beginning of the subject.

-Mukesh


On Thursday 01 September 2016 05:24 PM, Mukesh Ojha wrote:
> Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
> ---
>   libc/stdio/vsnprintf.c | 4 ++--
>   libc/string/strcat.c   | 2 +-
>   libc/string/strstr.c   | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c
> index fbb84a0..f771f2e 100644
> --- a/libc/stdio/vsnprintf.c
> +++ b/libc/stdio/vsnprintf.c
> @@ -26,7 +26,7 @@ static int
>   print_str_fill(char **buffer, size_t bufsize, char *sizec,
>   					const char *str, char c)
>   {
> -	int i, sizei, len;
> +	size_t i sizei, len;
>   	char *bstart = *buffer;
>
>   	sizei = strtoul(sizec, NULL, 10);
> @@ -46,7 +46,7 @@ static int
>   print_str(char **buffer, size_t bufsize, const char *str)
>   {
>   	char *bstart = *buffer;
> -	int i;
> +	size_t i;
>
>   	for (i = 0; (i < strlen(str)) && ((*buffer - bstart) < bufsize); i++) {
>   		**buffer = str[i];
> diff --git a/libc/string/strcat.c b/libc/string/strcat.c
> index eb597a0..936e5b1 100644
> --- a/libc/string/strcat.c
> +++ b/libc/string/strcat.c
> @@ -15,7 +15,7 @@
>   char *
>   strcat(char *dst, const char *src)
>   {
> -	int p;
> +	size_t p;
>
>   	p = strlen(dst);
>   	strcpy(&dst[p], src);
> diff --git a/libc/string/strstr.c b/libc/string/strstr.c
> index 3e090d2..a6e9618 100644
> --- a/libc/string/strstr.c
> +++ b/libc/string/strstr.c
> @@ -16,7 +16,7 @@ char *
>   strstr(const char *hay, const char *needle)
>   {
>   	char *pos;
> -	int hlen, nlen;
> +	size_t hlen, nlen;
>
>   	if (hay == NULL || needle == NULL)
>   		return NULL;



More information about the Skiboot mailing list