diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-26 13:09:31 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-26 13:09:31 +0400 |
commit | 18d2dd7e3ae0338829fd61740151f41c21668474 (patch) | |
tree | 53d755b496944c9017c2cda0ac812e7c545f4024 /source/blender/blenkernel/intern/library.c | |
parent | fc9e0a37f0087d003808a87c26e46ed573ae39dd (diff) | |
parent | f1ed223e34e61777af46d33e5bfc2fc03223a689 (diff) |
Merging r55547 through r55594 from trunk into soc-2008-mxcurioni
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 594905bf7c5..56480434b70 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -71,11 +71,13 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" #include "BLI_utildefines.h" -#include "BKE_bpath.h" + +#include "BLF_translation.h" #include "BKE_action.h" #include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_bpath.h" #include "BKE_brush.h" #include "BKE_camera.h" #include "BKE_context.h" @@ -1370,25 +1372,23 @@ bool new_id(ListBase *lb, ID *id, const char *tname) char name[MAX_ID_NAME - 2]; /* if library, don't rename */ - if (id->lib) return false; + if (id->lib) + return false; /* if no libdata given, look up based on ID */ - if (lb == NULL) lb = which_libbase(G.main, GS(id->name)); + if (lb == NULL) + lb = which_libbase(G.main, GS(id->name)); /* if no name given, use name of current ID * else make a copy (tname args can be const) */ if (tname == NULL) tname = id->name + 2; - strncpy(name, tname, sizeof(name) - 1); - - /* if result > MAX_ID_NAME-3, strncpy don't put the final '\0' to name. - * easier to assign each time then to check if its needed */ - name[sizeof(name) - 1] = 0; + BLI_strncpy(name, tname, sizeof(name)); if (name[0] == '\0') { /* disallow empty names */ - strcpy(name, ID_FALLBACK_NAME); + BLI_strncpy(name, DATA_(ID_FALLBACK_NAME), sizeof(name)); } else { /* disallow non utf8 chars, |