tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Support for mbsnrtowcs and wcsnrtomb



Joerg Sonnenberger wrote:
> Check the code in citrus_ctype_template.h for mbsrtowcs, specifically,
> the call to _FUNCNAME(init_state). That is required:
> 
> "If conversion stopped due to reaching a terminating null character, and
> if dst is not a null pointer, the resulting state described shall be the
> initial conversion state"

... but this state cannot be reached otherwise than after a successful
call to mbrtowc() which returned the final L'\0', and in such a case it
is already a requirement for the resulting state to "shall be the
initial conversion state."

So while not explicitly, it is already done; and the code in the
template is probably of belt-and-suspenders kind (which doesn't hurt.)


Antoine


Home | Main Index | Thread Index | Old Index