@@ -458,9 +458,9 @@ CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc,
458
458
// Ugh; must stat.
459
459
char subdirPath [CFMaxPathLength ];
460
460
struct statinfo statBuf ;
461
- strlcpy (subdirPath , dirPath , sizeof (subdirPath ));
462
- strlcat (subdirPath , "/" , sizeof (subdirPath ));
463
- strlcat (subdirPath , dp -> d_name , sizeof (subdirPath ));
461
+ cf_strlcpy (subdirPath , dirPath , sizeof (subdirPath ));
462
+ cf_strlcat (subdirPath , "/" , sizeof (subdirPath ));
463
+ cf_strlcat (subdirPath , dp -> d_name , sizeof (subdirPath ));
464
464
if (stat (subdirPath , & statBuf ) == 0 ) {
465
465
isDir = ((statBuf .st_mode & S_IFMT ) == S_IFDIR );
466
466
}
@@ -1040,7 +1040,7 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
1040
1040
// Make sure there is room for the additional space we need in the win32 api
1041
1041
if (strlen (directoryPathBuf ) > CFMaxPathSize - 2 ) return ;
1042
1042
1043
- strlcat (directoryPathBuf , "\\*" , CFMaxPathSize );
1043
+ cf_strlcat (directoryPathBuf , "\\*" , CFMaxPathSize );
1044
1044
1045
1045
UniChar wideBuf [CFMaxPathSize ];
1046
1046
@@ -1110,8 +1110,8 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
1110
1110
struct stat statBuf ;
1111
1111
char pathToStat [sizeof (dent -> d_name )];
1112
1112
strncpy (pathToStat , directoryPathBuf , sizeof (pathToStat ));
1113
- strlcat (pathToStat , "/" , sizeof (pathToStat ));
1114
- strlcat (pathToStat , dent -> d_name , sizeof (pathToStat ));
1113
+ cf_strlcat (pathToStat , "/" , sizeof (pathToStat ));
1114
+ cf_strlcat (pathToStat , dent -> d_name , sizeof (pathToStat ));
1115
1115
if (stat (pathToStat , & statBuf ) == 0 ) {
1116
1116
if (S_ISDIR (statBuf .st_mode )) {
1117
1117
dent -> d_type = DT_DIR ;
@@ -1135,7 +1135,7 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
1135
1135
CFStringRef fileName = CFStringCreateWithFileSystemRepresentation (kCFAllocatorSystemDefault , dent -> d_name );
1136
1136
1137
1137
// This buffer has to be 1 bigger than the size of the one in the dirent so we can hold the extra '/' if it's required
1138
- // Be sure to initialize the first character to null, so that strlcat below works correctly
1138
+ // Be sure to initialize the first character to null, so that cf_strlcat below works correctly
1139
1139
#if TARGET_OS_WASI
1140
1140
// wasi-libc's dirent.d_name is not a fixed-size array but a pointer, so we need to calculate
1141
1141
// the size of buffer at first.
@@ -1199,8 +1199,8 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
1199
1199
struct stat statBuf ;
1200
1200
char pathToStat [sizeof (dent -> d_name )];
1201
1201
strncpy (pathToStat , directoryPathBuf , sizeof (pathToStat ));
1202
- strlcat (pathToStat , "/" , sizeof (pathToStat ));
1203
- strlcat (pathToStat , dent -> d_name , sizeof (pathToStat ));
1202
+ cf_strlcat (pathToStat , "/" , sizeof (pathToStat ));
1203
+ cf_strlcat (pathToStat , dent -> d_name , sizeof (pathToStat ));
1204
1204
if (stat (pathToStat , & statBuf ) == 0 ) {
1205
1205
isDirectory = S_ISDIR (statBuf .st_mode );
1206
1206
}
@@ -1210,11 +1210,11 @@ CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean appendSla
1210
1210
1211
1211
if (isDirectory ) {
1212
1212
// Append the file name and the trailing /
1213
- strlcat (fullPathToFile , dent -> d_name , sizeof (fullPathToFile ));
1214
- strlcat (fullPathToFile , "/" , sizeof (fullPathToFile ));
1213
+ cf_strlcat (fullPathToFile , dent -> d_name , sizeof (fullPathToFile ));
1214
+ cf_strlcat (fullPathToFile , "/" , sizeof (fullPathToFile ));
1215
1215
} else if (stuffToPrefix ) {
1216
1216
// Append just the file name to our previously-used buffer
1217
- strlcat (fullPathToFile , dent -> d_name , sizeof (fullPathToFile ));
1217
+ cf_strlcat (fullPathToFile , dent -> d_name , sizeof (fullPathToFile ));
1218
1218
}
1219
1219
1220
1220
0 commit comments