use BLI_strnlen rather then strlen when comparing against fixed lengths.
[blender.git] / source / blender / editors / physics / physics_fluid.c
index 1801116fe0160f448b32aa6ebc208583621ed53b..da8e7e063f476ee52a7c6d0057fa25948c7c270c 100644 (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') ){