Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-13 06:21:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-13 06:21:27 +0300
commit867fc4b463ef39ea16103f18f332c3d259624d29 (patch)
tree7d20c416241afb7b878b767a9955e284d3cddbe2 /source/blender/modifiers/intern/MOD_fluidsim_util.c
parent9e03a0d4762b4734fe7ccb20e03b4a3c8f939620 (diff)
enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf(). also fix possible crash if CWD isnt available.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_fluidsim_util.c')
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index eb556e31aba..7d5c9a0ec13 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -459,7 +459,7 @@ DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData *fluid
displaymode = fss->renderDisplayMode;
}
- strncpy(targetDir, fss->surfdataPath, FILE_MAXDIR);
+ BLI_strncpy(targetDir, fss->surfdataPath, sizeof(targetDir));
// use preview or final mesh?
if(displaymode==1)
@@ -479,8 +479,7 @@ DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData *fluid
BLI_path_abs(targetDir, G.main->name);
BLI_path_frame(targetDir, curFrame, 0); // fixed #frame-no
- strcpy(targetFile,targetDir);
- strcat(targetFile, ".bobj.gz");
+ BLI_snprintf(targetFile, sizeof(targetFile), "%s.bobj.gz", targetDir);
dm = fluidsim_read_obj(targetFile);