[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34830] trunk/blender/source/blender/ windowmanager/intern/wm_files.c: fix for string copy error in own recent commit

Campbell Barton ideasman42 at gmail.com
Mon Feb 14 02:31:46 CET 2011


Revision: 34830
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34830
Author:   campbellbarton
Date:     2011-02-14 01:31:44 +0000 (Mon, 14 Feb 2011)
Log Message:
-----------
fix for string copy error in own recent commit

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_files.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c	2011-02-13 23:47:30 UTC (rev 34829)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2011-02-14 01:31:44 UTC (rev 34830)
@@ -500,9 +500,7 @@
 		if (fp) {
 			/* add current file to the beginning of list */
 			recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
-			recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(G.main->name)+1), "name of file");
-			recent->filepath[0] = '\0';
-			BLI_strncpy(recent->filepath, G.main->name, sizeof(recent->filepath));
+			recent->filepath = BLI_strdup(G.main->name);
 			BLI_addhead(&(G.recent_files), recent);
 			/* write current file to recent-files.txt */
 			fprintf(fp, "%s\n", recent->filepath);




More information about the Bf-blender-cvs mailing list