Fix [#26207] Render.exe mangles paths in mysterious and awesome ways
authorNathan Letwory <nathan@letworyinteractive.com>
Tue, 1 Mar 2011 12:52:00 +0000 (12:52 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Tue, 1 Mar 2011 12:52:00 +0000 (12:52 +0000)
Reported by Edwin Amsler

The function for extrapolating the template name with the frame number didn't properly NULL-terminate the
resulting string, this causing broken names and weird paths (if you were lucky - totally unusuable names
detected while stepping through the code).

source/blender/blenlib/intern/path_util.c

index 3b26f9f..7b6afd6 100644 (file)
@@ -609,6 +609,7 @@ int BLI_path_frame(char *path, int frame, int digits)
                p= tmp + ch_sta;
                p += sprintf(p, format, frame);
                memcpy(p, path + ch_end, strlen(path + ch_end));
+               *(tmp+strlen(path)) = '\0';
 #endif
                strcpy(path, tmp);
                return 1;