Piotr Caban : msvcrt: Fix handling of locales without region in MSVCRT_locale_to_LCID.

Alexandre Julliard julliard at winehq.org
Fri Oct 14 14:14:47 CDT 2011


Module: wine
Branch: master
Commit: 922ae2e2689bf9d0161754dfad031704e40542b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=922ae2e2689bf9d0161754dfad031704e40542b7

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Oct 13 23:29:27 2011 +0200

msvcrt: Fix handling of locales without region in MSVCRT_locale_to_LCID.

---

 dlls/msvcrt/locale.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 8d71c11..6733522 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -232,7 +232,7 @@ LCID MSVCRT_locale_to_LCID(const char *locale)
 
     if(cp) {
         lstrcpynA(search.search_codepage, cp+1, MAX_ELEM_LEN);
-        if(cp-region-1 < MAX_ELEM_LEN)
+        if(region && cp-region-1<MAX_ELEM_LEN)
           search.search_country[cp-region-1] = '\0';
         if(cp-locale < MAX_ELEM_LEN)
             search.search_language[cp-locale] = '\0';




More information about the wine-cvs mailing list