fix sizeof use, thanks to kim woelders

SVN revision: 55739
This commit is contained in:
Mike Blumenkrantz 2010-12-23 16:47:05 +00:00
parent feb6934d2b
commit 7da2c81f01
1 changed files with 2 additions and 1 deletions

View File

@ -1435,7 +1435,8 @@ e_hints_window_e_state_get(E_Border *bd)
int num, i;
memset(state, 0, sizeof(state));
num = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_WINDOW_STATE, state, sizeof(state));
num = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_WINDOW_STATE,
state, sizeof(state) / sizeof(state[0]); /* ugly, but avoids possible future overflow if more states are added */
if (!num) return;
for (i = 0; (i < num) && (i < sizeof(state)); i++)