@@ -2009,24 +2009,24 @@ bool IsFileExtension(const char *fileName, const char *ext)
20092009
20102010 if (fileExt != NULL )
20112011 {
2012- int fileExtLen = (int )strlen (fileExt );
2012+ int fileExtLength = (int )strlen (fileExt );
20132013 char fileExtLower [16 ] = { 0 };
20142014 char * fileExtLowerPtr = fileExtLower ;
2015- for (int i = 0 ; (i < fileExtLen ) && (i < 16 ); i ++ )
2015+ for (int i = 0 ; (i < fileExtLength ) && (i < 16 ); i ++ )
20162016 {
20172017 // Copy and convert to lower-case
20182018 if ((fileExt [i ] >= 'A' ) && (fileExt [i ] <= 'Z' )) fileExtLower [i ] = fileExt [i ] + 32 ;
20192019 else fileExtLower [i ] = fileExt [i ];
20202020 }
20212021
20222022 int extCount = 1 ;
2023- int extLen = (int )strlen (ext );
2024- char * extList = (char * )RL_CALLOC (extLen + 1 , 1 );
2023+ int extLength = (int )strlen (ext );
2024+ char * extList = (char * )RL_CALLOC (extLength + 1 , 1 );
20252025 char * extListPtrs [MAX_FILE_EXTENSIONS ] = { 0 };
2026- strncpy (extList , ext , extLen );
2026+ strncpy (extList , ext , extLength );
20272027 extListPtrs [0 ] = extList ;
20282028
2029- for (int i = 0 ; i < extLen ; i ++ )
2029+ for (int i = 0 ; i < extLength ; i ++ )
20302030 {
20312031 // Convert to lower-case if extension is upper-case
20322032 if ((extList [i ] >= 'A' ) && (extList [i ] <= 'Z' )) extList [i ] += 32 ;
@@ -2163,9 +2163,9 @@ const char *GetFileNameWithoutExt(const char *filePath)
21632163 if (filePath != NULL )
21642164 {
21652165 strncpy (fileName , GetFileName (filePath ), MAX_FILENAME_LENGTH - 1 ); // Get filename.ext without path
2166- int size = (int )strlen (fileName ); // Get size in bytes
2166+ int fileNameLenght = (int )strlen (fileName ); // Get size in bytes
21672167
2168- for (int i = size ; i > 0 ; i -- ) // Reverse search '.'
2168+ for (int i = fileNameLenght ; i > 0 ; i -- ) // Reverse search '.'
21692169 {
21702170 if (fileName [i ] == '.' )
21712171 {
@@ -2232,11 +2232,11 @@ const char *GetPrevDirectoryPath(const char *dirPath)
22322232{
22332233 static char prevDirPath [MAX_FILEPATH_LENGTH ] = { 0 };
22342234 memset (prevDirPath , 0 , MAX_FILEPATH_LENGTH );
2235- int pathLen = (int )strlen (dirPath );
2235+ int dirPathLength = (int )strlen (dirPath );
22362236
2237- if (pathLen <= 3 ) strncpy (prevDirPath , dirPath , MAX_FILEPATH_LENGTH - 1 );
2237+ if (dirPathLength <= 3 ) strncpy (prevDirPath , dirPath , MAX_FILEPATH_LENGTH - 1 );
22382238
2239- for (int i = (pathLen - 1 ); (i >= 0 ) && (pathLen > 3 ); i -- )
2239+ for (int i = (dirPathLength - 1 ); (i >= 0 ) && (dirPathLength > 3 ); i -- )
22402240 {
22412241 if ((dirPath [i ] == '\\' ) || (dirPath [i ] == '/' ))
22422242 {
@@ -2323,8 +2323,8 @@ const char *GetApplicationDirectory(void)
23232323
23242324 if (_NSGetExecutablePath (appDir , & size ) == 0 )
23252325 {
2326- int len = strlen (appDir );
2327- for (int i = len ; i >= 0 ; -- i )
2326+ int appDirLength = ( int ) strlen (appDir );
2327+ for (int i = appDirLength ; i >= 0 ; -- i )
23282328 {
23292329 if (appDir [i ] == '/' )
23302330 {
@@ -2346,8 +2346,8 @@ const char *GetApplicationDirectory(void)
23462346
23472347 if (sysctl (mib , 4 , appDir , & size , NULL , 0 ) == 0 )
23482348 {
2349- int len = strlen (appDir );
2350- for (int i = len ; i >= 0 ; -- i )
2349+ int appDirLength = ( int ) strlen (appDir );
2350+ for (int i = appDirLength ; i >= 0 ; -- i )
23512351 {
23522352 if (appDir [i ] == '/' )
23532353 {
@@ -2442,12 +2442,12 @@ int MakeDirectory(const char *dirPath)
24422442 if (DirectoryExists (dirPath )) return 0 ; // Path already exists (is valid)
24432443
24442444 // Copy path string to avoid modifying original
2445- int len = (int )strlen (dirPath ) + 1 ;
2446- char * pathcpy = (char * )RL_CALLOC (len , 1 );
2447- memcpy (pathcpy , dirPath , len );
2445+ int dirPathLength = (int )strlen (dirPath ) + 1 ;
2446+ char * pathcpy = (char * )RL_CALLOC (dirPathLength , 1 );
2447+ memcpy (pathcpy , dirPath , dirPathLength );
24482448
24492449 // Iterate over pathcpy, create each subdirectory as needed
2450- for (int i = 0 ; (i < len ) && (pathcpy [i ] != '\0' ); i ++ )
2450+ for (int i = 0 ; (i < dirPathLength ) && (pathcpy [i ] != '\0' ); i ++ )
24512451 {
24522452 if (pathcpy [i ] == ':' ) i ++ ;
24532453 else
@@ -2499,10 +2499,10 @@ bool IsFileNameValid(const char *fileName)
24992499
25002500 if ((fileName != NULL ) && (fileName [0 ] != '\0' ))
25012501 {
2502- int length = (int )strlen (fileName );
2502+ int fileNameLength = (int )strlen (fileName );
25032503 bool allPeriods = true;
25042504
2505- for (int i = 0 ; i < length ; i ++ )
2505+ for (int i = 0 ; i < fileNameLength ; i ++ )
25062506 {
25072507 // Check invalid characters
25082508 if ((fileName [i ] == '<' ) ||
@@ -2528,15 +2528,15 @@ bool IsFileNameValid(const char *fileName)
25282528 if (valid)
25292529 {
25302530 // Check invalid DOS names
2531- if (length >= 3)
2531+ if (fileNameLength >= 3)
25322532 {
25332533 if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'N')) || // CON
25342534 ((fileName[0] == 'P') && (fileName[1] == 'R') && (fileName[2] == 'N')) || // PRN
25352535 ((fileName[0] == 'A') && (fileName[1] == 'U') && (fileName[2] == 'X')) || // AUX
25362536 ((fileName[0] == 'N') && (fileName[1] == 'U') && (fileName[2] == 'L'))) valid = false; // NUL
25372537 }
25382538
2539- if (length >= 4)
2539+ if (fileNameLength >= 4)
25402540 {
25412541 if (((fileName[0] == 'C') && (fileName[1] == 'O') && (fileName[2] == 'M') && ((fileName[3] >= '0') && (fileName[3] <= '9'))) || // COM0-9
25422542 ((fileName[0] == 'L') && (fileName[1] == 'P') && (fileName[2] == 'T') && ((fileName[3] >= '0') && (fileName[3] <= '9')))) valid = false; // LPT0-9
0 commit comments