diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 10:35:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 10:35:21 +0300 |
commit | e179c92a278160ad3a1523a17ef272f6f3547f46 (patch) | |
tree | 743ba7ec0ac67b6afc202cdd7a5d063d6ee617ae /source/blender/editors/space_node | |
parent | 0ebdbdac00fda4ceb7f8a53e3b944575a8d76133 (diff) |
tedious string copying changes
- use sizeof() in more places.
- fixed some off by 1 bugs copying strings. setting curve font family for instance was 1 char too short.
- replace strncpy and strcpy with BLI_strncpy
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index aef1c7bbeaa..c34ade4f5e2 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -198,7 +198,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) node->id= &tex->id; id_us_plus(node->id); - BLI_strncpy(node->name, node->id->name+2, 21); + BLI_strncpy(node->name, node->id->name+2, sizeof(node->name)); nodeSetActive(ntree, node); @@ -285,7 +285,7 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) oldid= node->id; node->id= BLI_findlink(&bmain->text, node->menunr-1); id_us_plus(node->id); - BLI_strncpy(node->name, node->id->name+2, 21); /* huh? why 21? */ + BLI_strncpy(node->name, node->id->name+2, sizeof(node->name)); node->custom1= BSET(node->custom1, NODE_DYNAMIC_NEW); |