List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:March 24 2009 10:01am
Subject:Re: bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977
View as plain text  
Alfranio,

thanks!

You're absolutely right.

>>>> +// NB. number of printed bit values is limited to sizeof(buf)
>>>>  #define DBUG_PRINT_BITSET(N,FRM,BS)                \
>>>>    do {                                             \
>>>>      char buf[256];                                 \
>>>> -    for (uint i = 0 ; i < (BS)->n_bits ; ++i)      \
>>>> +    for (uint i = 0 ; i < min(sizeof(buf), (BS)->n_bits) ; ++i) \
>>>>        buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
>>>>   
>>>>       
>>
>>   
>>> If there is a reason, I think the set below is wrong.
>>>     
>>>>      buf[(BS)->n_bits] = '\0';                      \
>>>>   
>>>>       
>>> it should be buf[min(sizeof(buf), (BS)->n_bits)] = '\0';

sorry to miss your point in the last mail.


> But the previous expression should be replaced for something like this
>
> buf[min(sizeof(buf), (BS)->n_bits)] = '\0';

will change to that.


cheers,

Andrei
Thread
bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977Andrei Elkin23 Mar
  • Re: bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977Alfranio Correia23 Mar
    • Re: bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977Andrei Elkin24 Mar
      • Re: bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977Alfranio Correia24 Mar
        • Re: bzr commit into mysql-5.1-bugteam branch (aelkin:2844) Bug#42977Andrei Elkin24 Mar