Issue 213: Memcpy the right size for atoms

This commit is contained in:
Dave Davenport 2016-03-17 22:03:19 +01:00
parent 3a781d6fb9
commit cdd9f97072
1 changed files with 2 additions and 2 deletions

View File

@ -265,13 +265,13 @@ static client* window_client ( xcb_window_t win )
xcb_ewmh_get_atoms_reply_t states;
if ( xcb_ewmh_get_wm_state_reply ( &xcb->ewmh, cky, &states, NULL ) ) {
c->states = MIN ( CLIENTSTATE, states.atoms_len );
memcpy ( c->state, states.atoms, MIN ( CLIENTSTATE, states.atoms_len ) );
memcpy ( c->state, states.atoms, MIN ( CLIENTSTATE, states.atoms_len )*sizeof(xcb_atom_t) );
xcb_ewmh_get_atoms_reply_wipe ( &states );
}
cky = xcb_ewmh_get_wm_window_type ( &xcb->ewmh, win );
if ( xcb_ewmh_get_wm_window_type_reply ( &xcb->ewmh, cky, &states, NULL ) ) {
c->window_types = MIN ( CLIENTWINDOWTYPE, states.atoms_len );
memcpy ( c->window_type, states.atoms, MIN ( CLIENTWINDOWTYPE, states.atoms_len ) );
memcpy ( c->window_type, states.atoms, MIN ( CLIENTWINDOWTYPE, states.atoms_len )*sizeof(xcb_atom_t) );
xcb_ewmh_get_atoms_reply_wipe ( &states );
}