Introduction
Introduction Statistics Contact Development Disclaimer Help
segfault avoidance - lsw - lists window titles of X clients to stdout
git clone git://git.suckless.org/lsw
Log
Files
Refs
README
LICENSE
---
commit 4d6e1b39e14666dd0738301fa0ac1ab246ac1070
parent e36d7dd570a789685c4200e7fc8a929ad6c4ed8c
Author: Anselm R Garbe <[email protected]>
Date: Mon, 22 Dec 2014 11:36:47 +0100
segfault avoidance
Diffstat:
M lsw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lsw.c b/lsw.c
@@ -58,9 +58,9 @@ getname(Window win) {
if(!XmbTextPropertyToTextList(dpy, &prop, &list, &n) && n > 0) {
strncpy(buf, list[0], sizeof buf);
XFreeStringList(list);
- }
- else
+ } else
strncpy(buf, (char *)prop.value, sizeof buf);
XFree(prop.value);
+ buf[sizeof buf - 1] = '\0';
return buf;
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.