all repos — fluxbox @ 1982b853b5e14f4fc67c1cede269b8f1441249ed

custom fork of the fluxbox windowmanager

Fixed errorcheck in DrawRotString and DrawString
fluxgen fluxgen
commit

1982b853b5e14f4fc67c1cede269b8f1441249ed

parent

ee3bb66472216c9cfa55055cb30d4c61db0688d4

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M src/misc.ccsrc/misc.cc

@@ -366,15 +366,19 @@ }

} +//Draw title string void Misc::DrawString(Display *display, Window w, GC gc, Misc::Font *font, unsigned int text_w, unsigned int size_w, unsigned int bevel_w, char *text) { -//Draw title string + if (!text || text_w<1 || size_w < 1 || !font || !display) + return; + unsigned int l = text_w; int dlen=strlen(text); int dx=bevel_w*2; + if (text_w > size_w) { for (; dlen >= 0; dlen--) { if (I18n::instance()->multibyte()) {

@@ -426,6 +430,9 @@ unsigned int align, unsigned int text_w,

unsigned int size_w, unsigned int size_h, unsigned int bevel_w, char *text) { + if (!text || text_w<1 || size_w < 1 || !font || !display) + return; + unsigned int l = text_w; int dlen = strlen(text); int dx = bevel_w * 2;