diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
commit | 867fc4b463ef39ea16103f18f332c3d259624d29 (patch) | |
tree | 7d20c416241afb7b878b767a9955e284d3cddbe2 /source/blender/editors/interface/interface_draw.c | |
parent | 9e03a0d4762b4734fe7ccb20e03b4a3c8f939620 (diff) |
enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf().
also fix possible crash if CWD isnt available.
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 4ea0c01d15c..d6258d20b52 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -553,8 +553,6 @@ static void ui_draw_but_CHARTAB(uiBut *but) /* Set the font, in case it is not FO_BUILTIN_NAME font */ if(G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) { - char tmpStr[256]; - // Is the font file packed, if so then use the packed file if(G.selfont->packedfile) { @@ -563,9 +561,10 @@ static void ui_draw_but_CHARTAB(uiBut *but) } else { + char tmpStr[256]; int err; - strcpy(tmpStr, G.selfont->name); + BLI_strncpy(tmpStr, G.selfont->name, sizeof(tmpStr)); BLI_path_abs(tmpStr, G.main->name); err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0); } |