diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-03 12:31:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-03 12:40:29 +0400 |
commit | f489e0c14cbf852472a2c89328c37adfe4b9f21c (patch) | |
tree | 4f535d961190909493b59e021cc7fc770e87d842 | |
parent | 15bc30f4ee49c69f3ed6f92701a0f5cd52d306c5 (diff) |
Code Cleanup: remove strlen() and unneeded include in recent commit
also fix for incorrect sizeof() use.
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index bffb1b66afa..6139130d899 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -33,8 +33,6 @@ #include <string.h> #include <assert.h> -#include "MEM_guardedalloc.h" - #include "DNA_screen_types.h" #include "DNA_userdef_types.h" @@ -987,13 +985,13 @@ static void ui_text_clip_middle(uiFontStyle *fstyle, uiBut *but, const rcti *rec strwidth = BLF_width(fstyle->uifont_id, but->drawstr, sizeof(but->drawstr)); if (strwidth > okwidth) { - const char *sep = "..."; - const int sep_len = strlen(sep); + const char sep[] = "..."; + const int sep_len = sizeof(sep) - 1; const size_t max_len = sizeof(but->drawstr); size_t l_end; - const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sizeof(sep)); + const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1); const float parts_strwidth = ((float)okwidth - sep_strwidth) / 2.0f; if (parts_strwidth < (float)UI_DPI_ICON_SIZE) { |