Skip to content

Commit 204d6d1

Browse files
committed
ICU-23054 Correct parameter ordering for calloc().
1 parent 84dfb1d commit 204d6d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

icu4c/source/test/cintltst/cloctst.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,10 +1535,10 @@ static void TestISOFunctions(void)
15351535
static void setUpDataTable(void)
15361536
{
15371537
int32_t i,j;
1538-
dataTable = (UChar***)(calloc(sizeof(UChar**),LOCALE_INFO_SIZE));
1538+
dataTable = (UChar***)(calloc(LOCALE_INFO_SIZE, sizeof(UChar**)));
15391539

15401540
for (i = 0; i < LOCALE_INFO_SIZE; i++) {
1541-
dataTable[i] = (UChar**)(calloc(sizeof(UChar*),LOCALE_SIZE));
1541+
dataTable[i] = (UChar**)(calloc(LOCALE_SIZE, sizeof(UChar*)));
15421542
for (j = 0; j < LOCALE_SIZE; j++){
15431543
dataTable[i][j] = CharsToUChars(rawData2[i][j]);
15441544
}

icu4c/source/test/cintltst/custrtst.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ static void setUpDataTable(void)
7676
{
7777
int32_t i,j;
7878
if(dataTable == NULL) {
79-
dataTable = (UChar***)calloc(sizeof(UChar**),3);
79+
dataTable = (UChar***)calloc(3, sizeof(UChar**));
8080

8181
for (i = 0; i < 3; i++) {
82-
dataTable[i] = (UChar**)calloc(sizeof(UChar*),4);
82+
dataTable[i] = (UChar**)calloc(4, sizeof(UChar*));
8383
for (j = 0; j < 4; j++){
8484
dataTable[i][j] = (UChar*) malloc(sizeof(UChar)*(strlen(raw[i][j])+1));
8585
u_uastrcpy(dataTable[i][j],raw[i][j]);

0 commit comments

Comments
 (0)