diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-26 22:51:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-26 22:51:10 +0400 |
commit | 58587a38818b0dba25886c97d584285fef4e9249 (patch) | |
tree | 38e00681d39ee6a0f588232c9ef70ec5f80e22df /source/blender/editors/space_text/text_draw.c | |
parent | e897c8e83e1277767d9a44cb0ecb6f8a279dddc3 (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/editors/space_text/text_draw.c')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 4c617115a3d..10d355bd0c3 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1421,8 +1421,7 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar) y -= st->lheight; - strncpy(str, item->name, SUGG_LIST_WIDTH); - str[SUGG_LIST_WIDTH] = '\0'; + BLI_strncpy(str, item->name, SUGG_LIST_WIDTH); w = text_font_width(st, str); |