- char newpath[MAX_PATH_SIZE] = "";
- uprv_strcpy(newpath, checkAgainst);
- uprv_strcat(newpath, U_FILE_SEP_STRING);
- uprv_strcat(newpath, dirEntry->d_name);
-
- if ((subDirp = opendir(newpath)) != NULL) {
+ UErrorCode status = U_ZERO_ERROR;
+ icu::CharString newpath(checkAgainst, -1, status);
+ newpath.append(U_FILE_SEP_STRING, -1, status);
+ newpath.append(dirEntry->d_name, -1, status);
+ if (U_FAILURE(status)) {
+ fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, u_errorName(status));
+ return FALSE;
+ };
+
+ if ((subDirp = opendir(newpath.data())) != NULL) {