summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 515e4e4..f26a943 100644
--- a/dwm.c
+++ b/dwm.c
@@ -924,8 +924,9 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size)
924 return 0; 924 return 0;
925 if (name.encoding == XA_STRING) { 925 if (name.encoding == XA_STRING) {
926 strncpy(text, (char *)name.value, size - 1); 926 strncpy(text, (char *)name.value, size - 1);
927 } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { 927 } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success) {
928 strncpy(text, *list, size - 1); 928 if (n > 0 && *list)
929 strncpy(text, *list, size - 1);
929 XFreeStringList(list); 930 XFreeStringList(list);
930 } 931 }
931 text[size - 1] = '\0'; 932 text[size - 1] = '\0';