use BLI_strnlen rather then strlen when comparing against fixed lengths.

This commit is contained in:
2010-12-05 23:50:55 +00:00
parent 9668c29ba0
commit 2f366d1544
10 changed files with 33 additions and 26 deletions

View File

@@ -665,7 +665,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// invalid dir, reset to current/previous
strcpy(blendDir, G.main->name);
BLI_splitdirstring(blendDir, blendFile);
if(strlen(blendFile)>6){
if(BLI_strnlen(blendFile, 7) > 6){
int len = strlen(blendFile);
if( (blendFile[len-6]=='.')&& (blendFile[len-5]=='b')&& (blendFile[len-4]=='l')&&
(blendFile[len-3]=='e')&& (blendFile[len-2]=='n')&& (blendFile[len-1]=='d') ){