Patchwork lib: fwts_acpi_method: use size_t instead of int

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

Comments

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi_method.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Alex Hung - April 11, 2012, 2:22 a.m.
On 04/10/2012 10:35 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_acpi_method.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index c68f8e4..885c8c8 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -164,12 +164,12 @@ fwts_list *fwts_method_get_names(void)
>    */
>   char *fwts_method_exists(char *name)
>   {
> -	int name_len = strlen(name);
> +	size_t name_len = strlen(name);
>   	fwts_list_link	*item;
>
>   	fwts_list_foreach(item, fwts_method_names) {
>   		char *method_name = fwts_list_data(char*, item);
> -		int len = strlen(method_name);
> +		size_t len = strlen(method_name);
>
>   		if (strncmp(name, method_name + len - name_len, name_len) == 0)
>   			return method_name;
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - April 11, 2012, 5:15 a.m.
On Wed, Apr 11, 2012 at 10:22 AM, Alex Hung <alex.hung@canonical.com> wrote:
> On 04/10/2012 10:35 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_acpi_method.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/lib/src/fwts_acpi_method.c
>> b/src/lib/src/fwts_acpi_method.c
>> index c68f8e4..885c8c8 100644
>> --- a/src/lib/src/fwts_acpi_method.c
>> +++ b/src/lib/src/fwts_acpi_method.c
>> @@ -164,12 +164,12 @@ fwts_list *fwts_method_get_names(void)
>>   */
>>  char *fwts_method_exists(char *name)
>>  {
>> -       int name_len = strlen(name);
>> +       size_t name_len = strlen(name);
>>        fwts_list_link  *item;
>>
>>        fwts_list_foreach(item, fwts_method_names) {
>>                char *method_name = fwts_list_data(char*, item);
>> -               int len = strlen(method_name);
>> +               size_t len = strlen(method_name);
>>
>>                if (strncmp(name, method_name + len - name_len, name_len)
>> == 0)
>>                        return method_name;
>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
index c68f8e4..885c8c8 100644
--- a/src/lib/src/fwts_acpi_method.c
+++ b/src/lib/src/fwts_acpi_method.c
@@ -164,12 +164,12 @@  fwts_list *fwts_method_get_names(void)
  */
 char *fwts_method_exists(char *name)
 {
-	int name_len = strlen(name);
+	size_t name_len = strlen(name);
 	fwts_list_link	*item;
 
 	fwts_list_foreach(item, fwts_method_names) {
 		char *method_name = fwts_list_data(char*, item);
-		int len = strlen(method_name);
+		size_t len = strlen(method_name);
 
 		if (strncmp(name, method_name + len - name_len, name_len) == 0)
 			return method_name;