http://bugs.winehq.org/show_bug.cgi?id=58968
--- Comment #4 from Rafał Mużyło galtgendo@o2.pl --- We might be looking at something close to a compiler bug here, due to a type mismatch.
The way wcsupr is implemented in msvcrt is by calling _wcsupr_s_l with '-1' as size, but the type for size is size_t (unsigned). _wcsupr_s_l doesn't really account for such values...
Just to verify my idea is going in the right direction, try changing that implementation in _wcsupr_l to - let's say '_wcsupr_s_l( str, wcslen(str)+1, locale);' (likely won't be quite correct for NULL str, but otherwise OK...well, unless I messed something up, so caution advised).