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/makesrna | |
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/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_fluidsim.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 81b4b75aa03..55045a927bc 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -85,14 +85,12 @@ static int fluidsim_find_lastframe(FluidsimSettings *fss) char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR]; int curFrame = 1; - strncpy(targetDir, fss->surfdataPath, FILE_MAXDIR); - strcat(targetDir,"fluidsurface_final_####"); + BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath); BLI_path_abs(targetDir, G.main->name); do { - strcpy(targetFile,targetDir); + BLI_strncpy(targetFile, targetDir, sizeof(targetFile)); BLI_path_frame(targetFile, curFrame++, 0); - strcat(targetFile, ".bobj.gz"); } while(BLI_exist(targetFile)); return curFrame - 1; |