From: Christophe CURIS <christophe.cu...@free.fr>

As pointed by Coverity, despite apparent checks the function would fail if
trying to set a NULL title. Instead of trying to do over-complicated things
we just ignore (with a warning if NDEBUG is not set) the case. If user
wants an empty title, the correct way is to provide "" as we're not able to
remove a title.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 WINGs/wwindow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/WINGs/wwindow.c b/WINGs/wwindow.c
index e600f89..5293f87 100644
--- a/WINGs/wwindow.c
+++ b/WINGs/wwindow.c
@@ -255,12 +255,12 @@ static void setMiniwindow(WMWindow *win, RImage *image)
 
 void WMSetWindowTitle(WMWindow * win, const char *title)
 {
+       wassertr(title != NULL);
+
        if (win->title != NULL)
                wfree(win->title);
-       if (title != NULL)
-               win->title = wstrdup(title);
-       else
-               win->title = NULL;
+
+       win->title = wstrdup(title);
 
        if (win->view->flags.realized) {
                setWindowTitle(win, title);
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to