On Sunday 14 June 2026 13:03:47 Kirill Makurin wrote:
> > -  if (ret == 0 || ret > mb_cur_max || defaultCharacterUsed) {
> > +  if (ret <= 0 || ret > mb_cur_max || defaultCharacterUsed) {
> >      goto eilseq;
> >    }
> 
> Does WideCharToMultiByte ever return negative values? Microsoft docs only 
> mention zero as return value on error.

It is not documented. But we know that valid values for ret should be (0, 
mb_cur_max]
so it is better to explicitly reject any invalid ret value.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to