From 1982b853b5e14f4fc67c1cede269b8f1441249ed Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 16 Dec 2001 23:28:22 +0000 Subject: Fixed errorcheck in DrawRotString and DrawString --- src/misc.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/misc.cc b/src/misc.cc index 37e2580..728c5ae 100644 --- a/src/misc.cc +++ b/src/misc.cc @@ -366,15 +366,19 @@ void Misc::XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawab } +//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 @@ void Misc::DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font 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; -- cgit v0.11.2