diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-14 04:31:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-14 04:31:44 +0300 |
commit | 650916941ee7d459711dec9a6a73a1d6c56f3c20 (patch) | |
tree | 8f195a7bb6aafddf3016033447c9abb8303cc186 /source/blender/windowmanager | |
parent | 4ca2905ead92f23b1aca7bdbcc23c605dd830a87 (diff) |
fix for string copy error in own recent commit
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 31873160944..0bfbb15f4ba 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -500,9 +500,7 @@ static void write_history(void) 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); |