diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-02 14:35:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-02 14:35:42 +0400 |
commit | 02aec1e758732a8a307b552b464da2fef3865f7b (patch) | |
tree | 420c95fa541c382c68eabfd7404da1e83c7a9932 /source/blender/editors/interface/interface_widgets.c | |
parent | 1815225faa75eb64e83fdc9f066fcd6339502d52 (diff) |
User Interface: fix for crash pressing Ctrl+Delete
also remove redundant string duplication.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 27f16a6fd5c..06213340f77 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1008,13 +1008,9 @@ static void ui_text_clip_cursor(uiFontStyle *fstyle, uiBut *but, const rcti *rec while (but->strwidth > okwidth) { float width; - char buf[UI_MAX_DRAW_STR]; - /* copy draw string */ - BLI_strncpy_utf8(buf, but->drawstr, sizeof(buf)); /* string position of cursor */ - buf[but->pos] = 0; - width = BLF_width(fstyle->uifont_id, buf + but->ofs, sizeof(buf) - but->ofs); + width = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs, but->pos - but->ofs); /* if cursor is at 20 pixels of right side button we clip left */ if (width > okwidth - 20) { |