From 667fbe879199c042a5fe46072b06805b4811ea19 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 31 Mar 2020 11:46:29 +0200 Subject: [PATCH] ntdll: Use wcspbrk() instead of strpbrkW(). Signed-off-by: Alexandre Julliard --- dlls/ntdll/locale.c | 10 +++++----- dlls/ntdll/ntdll_misc.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 6e885b0b2c4..1206a54f22e 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -845,7 +845,7 @@ static LCID unix_locale_to_lcid( const char *unix_name ) if (len == ARRAY_SIZE(buffer)) return 0; buffer[len] = 0; - if (!(p = strpbrkW( buffer, sepW ))) + if (!(p = wcspbrk( buffer, sepW ))) { if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW )) return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT ); @@ -857,7 +857,7 @@ static LCID unix_locale_to_lcid( const char *unix_name ) { *p++ = 0; country = p; - p = strpbrkW( p, sepW + 1 ); + p = wcspbrk( p, sepW + 1 ); } if (p && *p == '.') { @@ -1674,16 +1674,16 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags if (strlenW( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1; wcscpy( lang, name ); - if ((p = strpbrkW( lang, sepW )) && *p == '-') + if ((p = wcspbrk( lang, sepW )) && *p == '-') { *p++ = 0; country = p; - if ((p = strpbrkW( p, sepW )) && *p == '-') + if ((p = wcspbrk( p, sepW )) && *p == '-') { *p++ = 0; script = country; country = p; - p = strpbrkW( p, sepW ); + p = wcspbrk( p, sepW ); } if (p) *p = 0; /* FIXME: modifier is ignored */ /* second value can be script or country, check length to resolve the ambiguity */ diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index ca8d26ca82b..e7df143caca 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -305,6 +305,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... ); #define wcscpy(d,s) NTDLL_wcscpy(d,s) #define wcscat(d,s) NTDLL_wcscat(d,s) #define wcschr(s,c) NTDLL_wcschr(s,c) +#define wcspbrk(s,a) NTDLL_wcspbrk(s,a) #define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b) /* convert from straight ASCII to Unicode without depending on the current codepage */