From 45daffaafef46f74c14733568d3acb0d0178db44 Mon Sep 17 00:00:00 2001 From: Hidenori Takeshima Date: Fri, 25 Feb 2000 21:34:48 +0000 Subject: [PATCH] Fixed CharNextA/CharNextExA for DBCS. --- misc/lstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/lstr.c b/misc/lstr.c index 389b1f1dee1..51f9e464688 100644 --- a/misc/lstr.c +++ b/misc/lstr.c @@ -181,7 +181,7 @@ SEGPTR WINAPI AnsiPrev16( SEGPTR start, SEGPTR current ) LPSTR WINAPI CharNextA( LPCSTR ptr ) { if (!*ptr) return (LPSTR)ptr; - if (IsDBCSLeadByte( *ptr )) return (LPSTR)(ptr + 2); + if (IsDBCSLeadByte( *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2); return (LPSTR)(ptr + 1); } @@ -192,7 +192,7 @@ LPSTR WINAPI CharNextA( LPCSTR ptr ) LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags ) { if (!*ptr) return (LPSTR)ptr; - if (IsDBCSLeadByteEx( codepage, *ptr )) return (LPSTR)(ptr + 2); + if (IsDBCSLeadByteEx( codepage, *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2); return (LPSTR)(ptr + 1); }