]> granicus.if.org Git - icu/commitdiff
ICU-10505 Do not use u_austrncpy where not necessary
authorMichael Ow <mow@svn.icu-project.org>
Wed, 4 Dec 2013 21:38:30 +0000 (21:38 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Wed, 4 Dec 2013 21:38:30 +0000 (21:38 +0000)
X-SVN-Rev: 34710

icu4c/source/common/wintz.c

index 0af6dc4c139a03e678861c3ca9e6d106339932a3..bceaebb23a82d671410c077096bd97edcf1c200a 100644 (file)
@@ -17,7 +17,6 @@
 #include "cmemory.h"
 #include "cstring.h"
 
-#include "unicode/ustring.h"
 #include "unicode/ures.h"
 
 #   define WIN32_LEAN_AND_MEAN
@@ -250,7 +249,6 @@ uprv_detectWindowsTimeZone() {
     UErrorCode status = U_ZERO_ERROR;
     UResourceBundle* bundle = NULL;
     char* icuid = NULL;
-    UChar apiStd[MAX_LENGTH_ID];
     char apiStdName[MAX_LENGTH_ID];
     char regStdName[MAX_LENGTH_ID];
     char tmpid[MAX_LENGTH_ID];
@@ -279,8 +277,7 @@ uprv_detectWindowsTimeZone() {
 
     /* Convert the wchar_t* standard name to char* */
     uprv_memset(apiStdName, 0, sizeof(apiStdName));
-    u_strFromWCS(apiStd, MAX_LENGTH_ID, NULL, apiTZI.StandardName, -1, &status);
-    u_austrncpy(apiStdName, apiStd, sizeof(apiStdName) - 1);
+    wcstombs(apiStdName, apiTZI.StandardName, MAX_LENGTH_ID);
 
     tmpid[0] = 0;