msvcrt: Return error if last known character is further in the string then current character.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2015-12-21 11:22:55 +01:00 committed by Alexandre Julliard
parent 5e10634a5a
commit 9f532321d0
1 changed files with 3 additions and 0 deletions

View File

@ -520,6 +520,9 @@ unsigned int CDECL _mbcjmstojis(unsigned int c)
*/
unsigned char* CDECL _mbsdec(const unsigned char* start, const unsigned char* cur)
{
if(start >= cur)
return NULL;
if(get_mbcinfo()->ismbcodepage)
return (unsigned char *)(_ismbstrail(start,cur-1) ? cur - 2 : cur -1);