[changeset] uninitialized value bug in strncmp

Thorsten Meyer thorsten.meyier at gmx.de
Wed Jan 14 13:55:53 CST 2009


Hi,

Jaroslav Hajek wrote:
> On Mon, Jan 5, 2009 at 11:02 AM, Thorsten Meyer <thorsten.meyier at gmx.de> wrote:
>   
>> Jaroslav Hajek wrote:
>>
>> On Thu, Jan 1, 2009 at 1:20 PM, Thorsten Meyer <thorsten.meyier at gmx.de>
>> wrote:
>>
>>
>> Hi,
>>
>> here is a patch (against mercurial) for the following bug in strncmp:
>>
>> comparing a string with a cell array, the return value for non-character
>> cells is random:
>>
>> octave:1> strncmp("abc", {"abcd", 10}, 2)
>> ans =
>>
>>     1   164
>>
>> octave:2>
>> octave:2> strncmp("abc", {"abcd", 10}, 2)
>> ans =
>>
>>     1   191
>>
>> octave:3> strncmp("abc", {"abcd", 10}, 2)
>> ans =
>>
>>     1   184
>>
>> octave:4> strncmp("abc", {"abcd", 10}, 2)
>> ans =
>>
>>     1   138
>>
>> The reason is that in this particular case, the output value is left
>> uninitialized.
>>
>> regards
>>
>> Thorsten
>>
>> _______________________________________________
>> Bug-octave mailing list
>> Bug-octave at octave.org
>> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave
>>
>>
>>
>> Attachment missing?
>>
>>
>> Yes, sorry, here it is.
>>
>>
>>
>>     
>
> It's OK. Since you have now access to Savannah, please go ahead and
> push it. Let me know if you have problems.
>
> cheers
>
>   
John's patch has made mine obsolete. Anyway, what I would like to know:
how can I commit for example the third patch in my mercurial patch queue
to the regular repository? Do I have to export it and import it again
after hg qpop -a ?

Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090114/72c1d531/attachment.html 


More information about the Bug-octave mailing list