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>2010-04-18 12:54:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-18 12:54:42 +0400
commit01e2de7c538d4b0bbddefae7f5272af93a30319b (patch)
treefdd67b69e40f5220291db27cdbf7c5bad53b904a /source/blender/editors/space_node/node_draw.c
parent5e186d3de0fb9b75d5ffc0b5282a10d04b29f862 (diff)
was using uninitialized string for node name display, also use sizeof() rather then fixed values.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 9e83723c296..1acd42c036c 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -736,10 +736,10 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColor(TH_TEXT);
if(node->flag & NODE_CUSTOM_NAME)
- BLI_strncpy(showname, node->name, 32);
+ BLI_strncpy(showname, node->name, sizeof(showname));
else
/* todo: auto name display for node types */
- BLI_strncpy(showname, node->name, 32);
+ BLI_strncpy(showname, node->name, sizeof(showname));
//if(node->flag & NODE_MUTED)
// sprintf(showname, "[%s]", showname);
@@ -900,10 +900,10 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
if(node->flag & NODE_CUSTOM_NAME)
- BLI_strncpy(showname, node->name, 128);
+ BLI_strncpy(showname, node->name, sizeof(showname));
else
/* todo: auto name display */
- BLI_strncpy(showname, node->name, 128);
+ BLI_strncpy(showname, node->name, sizeof(showname));
//if(node->flag & NODE_MUTED)
// sprintf(showname, "[%s]", showname);
@@ -1045,9 +1045,9 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColor(TH_TEXT_HI);
if (gnode->flag & NODE_CUSTOM_NAME)
- strcat(showname, gnode->name);
+ BLI_strncpy(showname, gnode->name, sizeof(showname));
else
- strcpy(showname, ngroup->id.name+2);
+ BLI_strncpy(showname, ngroup->id.name+2, sizeof(showname));
// XXX this shows some scaling artifacts
UI_DrawString(rect.xmin+8.0f, rect.ymax+5.0f, showname);