diff mbox

lib: fwts_stringextras: use size_t instead of int

Message ID 1334069085-4028-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_stringextras.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Hung April 11, 2012, 2:13 a.m. UTC | #1
On 04/10/2012 10:44 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_stringextras.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_stringextras.c b/src/lib/src/fwts_stringextras.c
> index babf2ed..0143477 100644
> --- a/src/lib/src/fwts_stringextras.c
> +++ b/src/lib/src/fwts_stringextras.c
> @@ -27,7 +27,7 @@
>    */
>   void fwts_chop_newline(char *str)
>   {
> -	int len;
> +	size_t len;
>
>   	if (!str)
>   		return;
> @@ -47,7 +47,7 @@ void fwts_chop_newline(char *str)
>    */
>   char *fwts_realloc_strcat(char *orig, const char *newstr)
>   {
> -	int newlen = strlen(newstr);
> +	size_t newlen = strlen(newstr);
>
>   	if (orig) {
>   		if ((orig = realloc(orig, strlen(orig) + newlen + 1)) == NULL)
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin April 11, 2012, 5:17 a.m. UTC | #2
On Wed, Apr 11, 2012 at 10:13 AM, Alex Hung <alex.hung@canonical.com> wrote:
> On 04/10/2012 10:44 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_stringextras.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/lib/src/fwts_stringextras.c
>> b/src/lib/src/fwts_stringextras.c
>> index babf2ed..0143477 100644
>> --- a/src/lib/src/fwts_stringextras.c
>> +++ b/src/lib/src/fwts_stringextras.c
>> @@ -27,7 +27,7 @@
>>   */
>>  void fwts_chop_newline(char *str)
>>  {
>> -       int len;
>> +       size_t len;
>>
>>        if (!str)
>>                return;
>> @@ -47,7 +47,7 @@ void fwts_chop_newline(char *str)
>>   */
>>  char *fwts_realloc_strcat(char *orig, const char *newstr)
>>  {
>> -       int newlen = strlen(newstr);
>> +       size_t newlen = strlen(newstr);
>>
>>        if (orig) {
>>                if ((orig = realloc(orig, strlen(orig) + newlen + 1)) ==
>> NULL)
>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/src/lib/src/fwts_stringextras.c b/src/lib/src/fwts_stringextras.c
index babf2ed..0143477 100644
--- a/src/lib/src/fwts_stringextras.c
+++ b/src/lib/src/fwts_stringextras.c
@@ -27,7 +27,7 @@ 
  */
 void fwts_chop_newline(char *str)
 {
-	int len;
+	size_t len;
 
 	if (!str)
 		return;
@@ -47,7 +47,7 @@  void fwts_chop_newline(char *str)
  */
 char *fwts_realloc_strcat(char *orig, const char *newstr)
 {
-	int newlen = strlen(newstr);
+	size_t newlen = strlen(newstr);
 
 	if (orig) {
 		if ((orig = realloc(orig, strlen(orig) + newlen + 1)) == NULL)