From 4e03e83a53c60b397f7b727e2b9849a8b0f43a60 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 19 Jan 2007 20:33:00 +0000 Subject: Bugfix #5664 Report had a very strange crash, which in the end appeared to be using a filename of 165 chars long. This gave two bugs; - the readBlog() function failed on that - even worse: the struct Global still stored it in G.sce with 160 chars! This is definitely an important issue... and (for the devs reading the 64 bits discussion) really not something allmighty coders are needed for! :) --- source/blender/src/usiblender.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/src/usiblender.c') diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index ab6b15a1ae2..725d8742892 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -555,7 +555,7 @@ static void free_openrecent(void) static void readBlog(void) { - char name[FILE_MAXDIR+FILE_MAXFILE], filename[FILE_MAXFILE]; + char name[FILE_MAX], filename[FILE_MAX]; LinkNode *l, *lines; struct RecentFile *recent; char *line; @@ -570,11 +570,14 @@ static void readBlog(void) for (l= lines, num= 0; l && (num<10); l= l->next, num++) { line = l->link; if (!BLI_streq(line, "")) { - if (num==0) strcpy(G.sce, line); + if (num==0) + strcpy(G.sce, line); + recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); BLI_addtail(&(G.recent_files), recent); recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file"); recent->filename[0] = '\0'; + strcpy(recent->filename, line); } } -- cgit v1.2.3