diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-08 22:24:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-08 22:24:13 +0300 |
commit | f00906b630b752fcecd0b63cb52626a0b89f021e (patch) | |
tree | b62e583eef694e4fef734011014f0e7c2ada1bd6 /source/blender/editors/interface | |
parent | 2aa028e77d13963ad07957cb1ce738641ad409c6 (diff) |
[#20987] A small bug in logic editor
string was used, uninitialized.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index cd9ebe6996f..c54b062c815 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1499,7 +1499,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) } if(!buf) { - BLI_strncpy(str, "", maxlen); + str[0] = '\0'; } else if(buf && buf != str) { /* string was too long, we have to truncate */ @@ -1511,12 +1511,12 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) /* ID pointer */ if(but->idpoin_idpp) { /* Can be NULL for ID properties by python */ ID *id= *(but->idpoin_idpp); - if(id) + if(id) { BLI_strncpy(str, id->name+2, maxlen); + return; + } } - else { - str[0] = '\0'; - } + str[0] = '\0'; return; } else if(but->type == TEX) { @@ -2067,7 +2067,7 @@ void ui_check_but(uiBut *but) case HOTKEYEVT: if (but->flag & UI_SELECT) { - strncpy(but->drawstr, "", UI_MAX_DRAW_STR); + but->drawstr[0]= '\0'; if(but->modifier_key) { char *str= but->drawstr; |