Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Latest CVS + ZLE_UNICODE_SUPPORT on RHEL3



Peter wrote:
>        An mbstate_t  object  a  can  be
>        initialized to the initial state by zeroing it, for example using
> 
>               memset(&a, 0, sizeof(a));
> 
> but the standard gives no indication this is portable (though clearly

I think you can safely take it to be portable. I've seen it many times
before (though the last argument is usually written sizeof(mbstate_t))
and just using grep now shows that quite a good few open source programs
use it.

> Alternatively, since we're not going to be using this in multiple
> threads, we could use a NULL pointer and rely on the internal state.

Surely you might use it in another function call while in the middle of
using it. It's probably safest not to rely on the single internal state.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author