diff options
| -rw-r--r-- | dwm.c | 3 |
1 files changed, 1 insertions, 2 deletions
| @@ -910,8 +910,7 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) | |||
| 910 | if (!text || size == 0) | 910 | if (!text || size == 0) |
| 911 | return 0; | 911 | return 0; |
| 912 | text[0] = '\0'; | 912 | text[0] = '\0'; |
| 913 | XGetTextProperty(dpy, w, &name, atom); | 913 | if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) |
| 914 | if (!name.nitems) | ||
| 915 | return 0; | 914 | return 0; |
| 916 | if (name.encoding == XA_STRING) | 915 | if (name.encoding == XA_STRING) |
| 917 | strncpy(text, (char *)name.value, size - 1); | 916 | strncpy(text, (char *)name.value, size - 1); |
