Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2006-05-30 04:09:55 +0400
committerKen Hughes <khughes@pacific.edu>2006-05-30 04:09:55 +0400
commit6747501cfe07ee298dee86d2539604460e395534 (patch)
tree3968ae607cbcf2193ec8286a6838c450834ea6c6 /source/blender/src/usiblender.c
parent9c4eaf326f251a618b4d42dd246a61031ea88584 (diff)
Bugfix #4224 fix:
If G.recent[0] was empty last wasn't initialized, resulting in a segfault. While I was there, changed strcat() to strcpy() for Alexander :-)
Diffstat (limited to 'source/blender/src/usiblender.c')
-rw-r--r--source/blender/src/usiblender.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index f2dfd277ea4..8359226a0c0 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -540,7 +540,7 @@ static void writeBlog(void)
{
char name[FILE_MAXDIR+FILE_MAXFILE];
FILE *fp;
- int i, last;
+ int i, last= 0;
char refresh=0;
BLI_make_file_string("/", name, BLI_gethome(), ".Blog");
@@ -563,10 +563,8 @@ static void writeBlog(void)
}
/* refresh list of recent opened files in memory too */
for(i=last;i>0;i--) {
- if (strcmp(G.recent[i-1], G.sce)!=0) {
- G.recent[i][0]='\0';
- strcat(G.recent[i], G.recent[i-1]);
- }
+ if (strcmp(G.recent[i-1], G.sce)!=0)
+ strcpy(G.recent[i], G.recent[i-1]);
}
/* add current file to the beginning of list */
G.recent[0][0]='\0';