Patchwork lib: fwts_tag: use size_t instead of int

login
register
mail settings
Submitter Colin King
Date April 10, 2012, 2:46 p.m.
Message ID <1334069174-4287-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/151607/
State Accepted
Headers show

Comments

Colin King - April 10, 2012, 2:46 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_tag.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Alex Hung - April 11, 2012, 2:11 a.m.
On 04/10/2012 10:46 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/lib/src/fwts_tag.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
> index 24e0b53..c1ba33d 100644
> --- a/src/lib/src/fwts_tag.c
> +++ b/src/lib/src/fwts_tag.c
> @@ -150,11 +150,11 @@ char *fwts_tag_list_to_str(fwts_list *taglist)
>   {
>   	fwts_list_link	*item;
>   	char *str = NULL;
> -	int len = 0;
> +	size_t len = 0;
>
>   	fwts_list_foreach(item, taglist) {
>   		char *tag = fwts_list_data(char *, item);
> -		int taglen = strlen(tag);
> +		size_t taglen = strlen(tag);
>   		len += taglen + 1;
>
>   		if (str) {
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - April 11, 2012, 5:08 a.m.
On Wed, Apr 11, 2012 at 10:11 AM, Alex Hung <alex.hung@canonical.com> wrote:
> On 04/10/2012 10:46 PM, Colin King wrote:
>>
>> From: Colin Ian King<colin.king@canonical.com>
>>
>> Signed-off-by: Colin Ian King<colin.king@canonical.com>
>> ---
>>  src/lib/src/fwts_tag.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
>> index 24e0b53..c1ba33d 100644
>> --- a/src/lib/src/fwts_tag.c
>> +++ b/src/lib/src/fwts_tag.c
>> @@ -150,11 +150,11 @@ char *fwts_tag_list_to_str(fwts_list *taglist)
>>  {
>>        fwts_list_link  *item;
>>        char *str = NULL;
>> -       int len = 0;
>> +       size_t len = 0;
>>
>>        fwts_list_foreach(item, taglist) {
>>                char *tag = fwts_list_data(char *, item);
>> -               int taglen = strlen(tag);
>> +               size_t taglen = strlen(tag);
>>                len += taglen + 1;
>>
>>                if (str) {
>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
index 24e0b53..c1ba33d 100644
--- a/src/lib/src/fwts_tag.c
+++ b/src/lib/src/fwts_tag.c
@@ -150,11 +150,11 @@  char *fwts_tag_list_to_str(fwts_list *taglist)
 {
 	fwts_list_link	*item;
 	char *str = NULL;
-	int len = 0;
+	size_t len = 0;
 
 	fwts_list_foreach(item, taglist) {
 		char *tag = fwts_list_data(char *, item);
-		int taglen = strlen(tag);
+		size_t taglen = strlen(tag);
 		len += taglen + 1;
 
 		if (str) {