[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 2/3] seq: match f's type with strlen() result type
From:       Guilherme Maciel Ferreira <guilherme.maciel.ferreira () gmail ! com>
Date:       2014-07-28 12:54:53
Message-ID: CAF=5bWc=eBkhMX1Pb-tLbjYS4PAMCR_CBbcMHoEDnesKMeDXAg () mail ! gmail ! com
[Download RAW message or body]

Hi,

2014-07-26 15:05 GMT-03:00 walter harms <wharms@bfs.de>:
> actually strlen() returns size_t. When you really need this to be "correct"
> you should use size_t.

I know. I simply didn't see anywhere nearby using size_t, then I
assumed unsigned was used instead. But, I'd rather use size_t!

> Did you get an error with a certain system.

Nope, I just solve a compilation warning.

Best regards,

>
> re,
>  wh
>
> Am 26.07.2014 19:37, schrieb Guilherme Maciel Ferreira:
>> The variable f compares and receives only unsigned values.
>>
>> Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
>> ---
>>  coreutils/seq.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/coreutils/seq.c b/coreutils/seq.c
>> index 8986192..d3b449a 100644
>> --- a/coreutils/seq.c
>> +++ b/coreutils/seq.c
>> @@ -70,7 +70,7 @@ int seq_main(int argc, char **argv)
>>       while (1) {
>>               char *dot = strchrnul(*argv, '.');
>>               int w = (dot - *argv);
>> -             int f = strlen(dot);
>> +             unsigned f = strlen(dot);
>>               if (width < w)
>>                       width = w;
>>               argv++;
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox



-- 
Guilherme Maciel Ferreira
Mobile Brazil: +55 48 9917 3969
Site: http://guilhermemacielferreira.com/
Skype: guilherme.maciel.ferreira
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic