diff options
author | Jess VanDerwalker <washu@sonic.net> | 2012-07-25 11:23:01 -0700 |
---|---|---|
committer | Jess VanDerwalker <washu@sonic.net> | 2012-07-25 13:05:55 -0700 |
commit | 72257f8c6fb0010b61fff10600a58c8422822aec (patch) | |
tree | 6af7bab34b1382a977204cb1892144406741af64 | |
parent | d80dff4e181f830753500257a5e3dfc99a4ee390 (diff) |
libxcwm: Using strlen() to get length of atom names.
Calls to get atoms were previously using preset numbers. strlen guards
against atom name and length getting out of sync.
Signed-off-by: Jess VanDerwalker <washu@sonic.net>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r-- | src/libxcwm/init.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libxcwm/init.c b/src/libxcwm/init.c index 4be530f..988efd4 100644 --- a/src/libxcwm/init.c +++ b/src/libxcwm/init.c @@ -139,7 +139,7 @@ _xcwm_get_wm_atoms(xcwm_context_t *context) /* WM_PROTOCOLS */ atom_cookie = xcb_intern_atom(context->conn, 0, - 12, + strlen("WM_PROTOCOLS"), "WM_PROTOCOLS"); atom_reply = xcb_intern_atom_reply(context->conn, atom_cookie, @@ -155,7 +155,7 @@ _xcwm_get_wm_atoms(xcwm_context_t *context) /* WM_DELETE_WINDOW atom */ atom_cookie = xcb_intern_atom(context->conn, 0, - 16, + strlen("WM_DELETE_WINDOW"), "WM_DELETE_WINDOW"); atom_reply = xcb_intern_atom_reply(context->conn, atom_cookie, @@ -167,4 +167,5 @@ _xcwm_get_wm_atoms(xcwm_context_t *context) _wm_atoms->wm_delete_window_atom = atom_reply->atom; free(atom_reply); } + } |