use BLI_strncpy and BLI_snprintf when the size of the string is known.
[blender.git] / source / blender / editors / physics / physics_fluid.c
index cc60f4a..0bb5dbe 100644 (file)
@@ -146,7 +146,8 @@ static int fluid_is_animated_mesh(FluidsimSettings *fss)
 
 #if 0
 /* helper function */
-void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) {
+void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname)
+{
        //BLI_snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
        BLI_snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
 }
@@ -769,7 +770,8 @@ static void fluidbake_endjob(void *customdata)
        }
 }
 
-int runSimulationCallback(void *data, int status, int frame) {
+int runSimulationCallback(void *data, int status, int frame)
+{
        FluidBakeJob *fb = (FluidBakeJob *)data;
        elbeemSimulationSettings *settings = fb->settings;
        
@@ -1040,7 +1042,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
        fsset->surfaceSmoothing = domainSettings->surfaceSmoothing; 
        fsset->surfaceSubdivs = domainSettings->surfaceSubdivs; 
        fsset->farFieldSize = domainSettings->farFieldSize; 
-       BLI_strncpy(fsset->outputPath, targetFile, 240);
+       BLI_strncpy(fsset->outputPath, targetFile, sizeof(fsset->outputPath));
 
        // domain channels
        fsset->channelSizeFrameTime =