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