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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-26 22:51:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-26 22:51:10 +0400
commit58587a38818b0dba25886c97d584285fef4e9249 (patch)
tree38e00681d39ee6a0f588232c9ef70ec5f80e22df /source/blender/blenkernel/intern/key.c
parente897c8e83e1277767d9a44cb0ecb6f8a279dddc3 (diff)
replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination.
also dont call CTX_data_scene() twice when checking for function arguments.
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r--source/blender/blenkernel/intern/key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 4b8209ab77e..656bb3ef853 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1445,10 +1445,10 @@ KeyBlock *add_keyblock(Key *key, const char *name)
tot= BLI_countlist(&key->block);
if(name) {
- strncpy(kb->name, name, sizeof(kb->name));
+ BLI_strncpy(kb->name, name, sizeof(kb->name));
} else {
- if(tot==1) strcpy(kb->name, "Basis");
- else sprintf(kb->name, "Key %d", tot-1);
+ if(tot==1) BLI_strncpy(kb->name, "Basis", sizeof(kb->name));
+ else BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", tot-1);
}
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name));