]> granicus.if.org Git - icu/commitdiff
ICU-22085 Fix old typo on calculating path size in loadTestData() and add a few small...
authorRich Gillam <62772518+richgillam@users.noreply.github.com>
Tue, 12 Jul 2022 20:19:08 +0000 (13:19 -0700)
committerRich Gillam <62772518+richgillam@users.noreply.github.com>
Thu, 14 Jul 2022 15:53:16 +0000 (08:53 -0700)
icu4c/source/test/cintltst/cintltst.c
icu4c/source/test/cintltst/cucdtst.c

index 8e3ece02aff39b0afefbbf19bcf4e1fc7161900c..a3772defe790de26f693156f926d9fbb8f329a7a 100644 (file)
@@ -539,7 +539,10 @@ const char* loadTestData(UErrorCode* err){
         UResourceBundle* test =NULL;
         char* tdpath=NULL;
         const char* tdrelativepath;
-#if defined (U_TOPBUILDDIR)
+#if defined (APPLE_XCODE_BUILD)
+        tdrelativepath = "";
+        directory = U_TOPBUILDDIR;
+#elif defined (U_TOPBUILDDIR)
         tdrelativepath = "test"U_FILE_SEP_STRING"testdata"U_FILE_SEP_STRING"out"U_FILE_SEP_STRING;
         directory = U_TOPBUILDDIR;
 #else
@@ -547,7 +550,7 @@ const char* loadTestData(UErrorCode* err){
         directory= ctest_dataOutDir();
 #endif
 
-        tdpath = (char*) ctst_malloc(sizeof(char) *(( strlen(directory) * strlen(tdrelativepath)) + 10));
+        tdpath = (char*) ctst_malloc(sizeof(char) *(( strlen(directory) + strlen(tdrelativepath)) + 10));
 
 
         /* u_getDataDirectory shoul return \source\data ... set the
index 8e8b789086ea1078c0e361dae5a32e5b4d7b4d2d..f698dec434724e1a3d7137e74041551a931976d3 100644 (file)
@@ -75,8 +75,8 @@ parseUCDFile(const char *filename,
              char *fields[][2], int32_t fieldCount,
              UParseLineFn *lineFn, void *context,
              UErrorCode *pErrorCode) {
-    char path[256];
-    char backupPath[256];
+    char path[512];
+    char backupPath[512];
 
     if(U_FAILURE(*pErrorCode)) {
         return;