diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 12:58:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 12:58:28 +0300 |
commit | 3396f73c1719db18500d4741d4fc21d6bba9423c (patch) | |
tree | 077ff5327e232279874cdcfaecc55b0612e3617b /source/blender/blenkernel | |
parent | 5af9e5fda96bbf47ebf6bb5cfdd6b67bcbb365cb (diff) |
fix for possible (but unlikely) problem with strncpy not adding \0 and then extending the string with strcat. use BLI_snprintf instead.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 4d3a908edb0..2e2decdf84d 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3744,8 +3744,6 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) FluidsimSettings *fss= fluidmd->fss; ParticleSettings *part = psys->part; ParticleData *pa=NULL; - const char *suffix = "fluidsurface_particles_####"; - const char *suffix2 = ".gz"; char filename[256]; char debugStrBuffer[256]; int curFrame = sim->scene->r.cfra -1; // warning - sync with derived mesh fsmesh loading @@ -3755,14 +3753,13 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) // XXX if(ob==G.obedit) // off... // return; - + // ok, start loading - strcpy(filename, fss->surfdataPath); - strcat(filename, suffix); + BLI_snprintf(filename, sizeof(filename), "%sfluidsurface_particles_####.gz", fss->surfdataPath); + BLI_path_abs(filename, G.main->name); BLI_path_frame(filename, curFrame, 0); // fixed #frame-no - strcat(filename, suffix2); - + gzf = gzopen(filename, "rb"); if (!gzf) { snprintf(debugStrBuffer,256,"readFsPartData::error - Unable to open file for reading '%s' \n", filename); |