diff --git a/src/ui/theme.cpp b/src/ui/theme.cpp index e0fafc7af..b969ed2bb 100644 --- a/src/ui/theme.cpp +++ b/src/ui/theme.cpp @@ -8,9 +8,6 @@ #include "config.h" #endif -#include -#include - #include "gfx/point.h" #include "gfx/size.h" #include "she/font.h" @@ -146,7 +143,7 @@ void drawTextBox(Graphics* g, Widget* widget, // Without word-wrap if (!(widget->getAlign() & JI_WORDWRAP)) { - end = ustrchr(beg, '\n'); + end = strchr(beg, '\n'); if (end) { chr = *end; *end = 0; @@ -156,7 +153,7 @@ void drawTextBox(Graphics* g, Widget* widget, else { old_end = NULL; for (beg_end=beg;;) { - end = ustrpbrk(beg_end, " \n"); + end = strpbrk(beg_end, " \n"); if (end) { chr = *end; *end = 0; diff --git a/src/ui/widget.cpp b/src/ui/widget.cpp index 6f9bd0ba9..9e057a2a2 100644 --- a/src/ui/widget.cpp +++ b/src/ui/widget.cpp @@ -19,7 +19,6 @@ #include "ui/intern.h" #include "ui/ui.h" -#include #include #include #include @@ -139,21 +138,20 @@ void Widget::setText(const std::string& text) void Widget::setTextf(const char *format, ...) { - char buf[4096]; - // formatted string if (format) { va_list ap; va_start(ap, format); + char buf[4096]; vsprintf(buf, format, ap); va_end(ap); + + setText(buf); } // empty string else { - ustrcpy(buf, empty_string); + setText(""); } - - setText(buf); } void Widget::setTextQuiet(const std::string& text)