summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-04-20 08:49:44 +0200
committerDanny Baumann <dannybaumann@web.de>2009-04-20 08:49:44 +0200
commit308593faadf6a364789bf2f6d03e9b8bbc355435 (patch)
treef4cf9fd3bc4789790e9b6f735c2a5c2772ae2ea9
parent8263b66cf53766a5ce28b27ac604cb602201b8c5 (diff)
downloadtitleinfo-308593faadf6a364789bf2f6d03e9b8bbc355435.tar.gz
titleinfo-308593faadf6a364789bf2f6d03e9b8bbc355435.tar.bz2
Fix potential segfault.
-rw-r--r--titleinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/titleinfo.c b/titleinfo.c
index 7743198..88b5398 100644
--- a/titleinfo.c
+++ b/titleinfo.c
@@ -63,7 +63,7 @@ titleinfoUpdateVisibleName (CompWindow *w)
{
CompDisplay *d = w->screen->display;
char *text = NULL, *machine = NULL;
- const char *root = NULL, *title;
+ const char *root = "", *title;
TITLEINFO_DISPLAY (d);
TITLEINFO_WINDOW (w);
@@ -83,7 +83,7 @@ titleinfoUpdateVisibleName (CompWindow *w)
if (machine)
asprintf (&text, "%s%s (@%s)", root, title, machine);
- else if (root)
+ else if (root[0])
asprintf (&text, "%s%s", root, title);
if (text)