get_window_children: only decrement available size if element was

written.
This commit is contained in:
Uwe Bonnes 2002-04-11 17:32:10 +00:00 committed by Alexandre Julliard
parent 07a308d606
commit 4f7d893ccb
1 changed files with 2 additions and 1 deletions

View File

@ -553,11 +553,12 @@ DECL_HANDLER(get_window_children)
len = min( get_reply_max_size(), total * sizeof(user_handle_t) );
if (len && ((data = set_reply_data_size( len ))))
{
for (ptr = parent->first_child; ptr && len; ptr = ptr->next, len -= sizeof(*data))
for (ptr = parent->first_child; ptr && len; ptr = ptr->next)
{
if (req->atom && ptr->atom != req->atom) continue;
if (req->tid && get_thread_id(ptr->thread) != req->tid) continue;
*data++ = ptr->handle;
len -= sizeof(*data);
}
}
}