[PATCH resent 2/2] libs/port/mbtowc: Convert 1 character at a time if dst overlaps into src

Alexandre Julliard julliard at winehq.org
Wed Dec 19 07:16:49 CST 2018


Gabriel Ivăncescu <gabrielopcode at gmail.com> writes:

> Cause of bug discovered by Jason Edmeades.
>
> Some applications partially overlap the two buffers. Handle such rare corner
> cases without affecting performance in the general case.
>
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38558
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
>
> There are no risks of regression here, as the only case where it is slower
> now is when previously gave a completely wrong result.
>
> I assume performance is important for this function, since it had the switch
> statement in the first place...

Yes, that's why it would be better to do it the same way as the wcstombs
case.

Note that unless you can show that it affects more apps than the one
from the bug report, it will still have to wait until after code freeze.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list