Merging r40572 through r40597 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / blenloader / intern / readfile.c
index daf384dc95fd90869e3eeba29032c136423857e5..5c70f6ac9d47557c82c8ebee988f82c20de98877 100644 (file)
@@ -517,7 +517,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
        BLI_addtail(mainlist, m);
 
        lib= alloc_libblock(&m->library, ID_LI, "lib");
-       strncpy(lib->name, filepath, sizeof(lib->name)-1);
+       BLI_strncpy(lib->name, filepath, sizeof(lib->name));
        BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));
        
        m->curlib= lib;
@@ -5678,7 +5678,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
                         * link into an unsaved blend file. See [#27405].
                         * The remap relative option will make it relative again on save - campbell */
                        if (strncmp(lib->name, "//", 2)==0) {
-                               strncpy(lib->name, lib->filepath, sizeof(lib->name));
+                               BLI_strncpy(lib->name, lib->filepath, sizeof(lib->name));
                        }
                }
        }
@@ -5687,7 +5687,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
                        /* Libraries store both relative and abs paths, recreate relative paths,
                         * relative to the blend file since indirectly linked libs will be relative to their direct linked library */
                        if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to begin with? */
-                               strncpy(lib->name, lib->filepath, sizeof(lib->name));
+                               BLI_strncpy(lib->name, lib->filepath, sizeof(lib->name));
                                BLI_path_rel(lib->name, basepath);
                        }
                }
@@ -12411,7 +12411,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
        bfd->main->versionfile= fd->fileversion;
        
        bfd->type= BLENFILETYPE_BLEND;
-       strncpy(bfd->main->name, filepath, sizeof(bfd->main->name)-1);
+       BLI_strncpy(bfd->main->name, filepath, sizeof(bfd->main->name));
 
        while(bhead) {
                switch(bhead->code) {