Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2009 11:46:23 +0530
From:      Channa <channa.kad@gmail.com>
To:        Olivier Houchard <mlfbsd@ci0.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: strncmp issue
Message-ID:  <515c64960904282316k5f3e80cdu1c04a8dc3ab25883@mail.gmail.com>
In-Reply-To: <20090428193004.GA5465@ci0.org>
References:  <515c64960904280252sc9fe2afy24e8db8ab13b13e4@mail.gmail.com> <1240918262.85945.1.camel@buffy.york.ac.uk> <20090428115510.GA98699@ci0.org> <515c64960904280459p3c2ef8bdu3600157eb0c47bcc@mail.gmail.com> <20090428121255.GA99020@ci0.org> <515c64960904280702s5e29f916s5e03564adf96f9b0@mail.gmail.com> <20090428193004.GA5465@ci0.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/4/29 Olivier Houchard <mlfbsd@ci0.org>:
> On Tue, Apr 28, 2009 at 07:32:14PM +0530, Channa wrote:
>> Hi,
>>
>> Thank you very much for your response.
>> I am looking forward for your fix.
>>
>> Thanks & Regards,
>> Channa
>>
>
> Hi,
>
> I just committed a fix to -CURRENT, as rev 191633.
> It basically just checks if the length is 0, instead of len - 1 < 0.
>
> Thanks again,
>
> Olivier
>
>
>

Hi
Thank you very much. I used your fix and tested again.
When i tested as below :

TEST 1 :
  ret = strncmp("a", "L", -1);  <----------------- ret is '0'


TEST 2:
  ret = strncmp("1", "2", UINT_MAX); <------ ret is '-1'

But since size_t is unsigned int call to strncmp with third argument
as -1 should consider third argument  as UINT_MAX in TEST 1, but its
not happening so.

Could you please help me to know what could be the problem.

Thanks & Regards,
Channa



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?515c64960904282316k5f3e80cdu1c04a8dc3ab25883>