Merging r41120 through from trunk r41139 into soc-2011-tomato
[blender.git] / source / blender / blenloader / intern / readfile.c
index 916069a..dbef981 100644 (file)
@@ -9416,7 +9416,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                        simasel->prv_h = 96;
                                                        simasel->prv_w = 96;
                                                        simasel->flag = 7; /* ??? elubie */
-                                                       strcpy (simasel->dir,  U.textudir);     /* TON */
+                                                       BLI_strncpy (simasel->dir,  U.textudir, sizeof(simasel->dir)); /* TON */
                                                        simasel->file[0]= '\0';
                                                        
                                                        simasel->returnfunc     =  NULL;
@@ -9639,7 +9639,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                                ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
                                                                
                                                                ct->tar = data->tar;
-                                                               strcpy(ct->subtarget, data->subtarget);
+                                                               BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
                                                                ct->space = con->tarspace;
                                                                
                                                                BLI_addtail(&data->targets, ct);
@@ -9669,7 +9669,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
                                                
                                                ct->tar = data->tar;
-                                               strcpy(ct->subtarget, data->subtarget);
+                                               BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
                                                ct->space = con->tarspace;
                                                
                                                BLI_addtail(&data->targets, ct);
@@ -12149,8 +12149,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                aa->flag = ia->flag;
                                                aa->sta = ia->sta;
                                                aa->end = ia->end;
-                                               strcpy(aa->name, ia->name);
-                                               strcpy(aa->frameProp, ia->frameProp);
+                                               BLI_strncpy(aa->name, ia->name, sizeof(aa->name));
+                                               BLI_strncpy(aa->frameProp, ia->frameProp, sizeof(aa->frameProp));
                                                if (ob->adt)
                                                        aa->act = ob->adt->action;
 
@@ -13847,8 +13847,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                                        printf("  enter a new path:\n");
 
                                                        if(scanf("%s", newlib_path) > 0) {
-                                                               strcpy(mainptr->curlib->name, newlib_path);
-                                                               strcpy(mainptr->curlib->filepath, newlib_path);
+                                                               BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name));
+                                                               BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath));
                                                                cleanup_path(G.main->name, mainptr->curlib->filepath);
                                                                
                                                                fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
@@ -13964,7 +13964,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
 
 /* reading runtime */
 
-BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize, ReportList *reports)
+BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, ReportList *reports)
 {
        BlendFileData *bfd = NULL;
        FileData *fd = filedata_new();