Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4a5f55
)
better allocation
author
David Hill
<dhill@conformal.com>
Tue, 10 Jul 2012 18:42:07 +0000
(14:42 -0400)
committer
Reginald Kennedy
<rk@rejii.com>
Fri, 20 Jul 2012 21:58:32 +0000
(
05:58
+0800)
spectrwm.c
patch
|
blob
|
history
diff --git
a/spectrwm.c
b/spectrwm.c
index
6242368
..
7291eb1
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-3738,12
+3738,12
@@
get_win_name(xcb_window_t win)
c = xcb_icccm_get_wm_name(conn, win);
if (xcb_icccm_get_wm_name_reply(conn, c, &r, NULL)) {
c = xcb_icccm_get_wm_name(conn, win);
if (xcb_icccm_get_wm_name_reply(conn, c, &r, NULL)) {
- name = malloc((r.name_len + 1) * sizeof(char *));
+ name = malloc(1, r.name_len + 1);
if (!name) {
xcb_get_text_property_reply_wipe(&r);
return (NULL);
}
if (!name) {
xcb_get_text_property_reply_wipe(&r);
return (NULL);
}
- memcpy(name, r.name, r.name_len * sizeof(char *));
+ memcpy(name, r.name, r.name_len);
name[r.name_len] = '\0';
}
name[r.name_len] = '\0';
}