diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -924,8 +924,9 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) return 0; if (name.encoding == XA_STRING) { strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); + } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success) { + if (n > 0 && *list) + strncpy(text, *list, size - 1); XFreeStringList(list); } text[size - 1] = '\0'; |
