s3:winbind:pwent: move resetting next_user up.
authorMichael Adam <obnox@samba.org>
Tue, 20 Jan 2015 10:06:51 +0000 (11:06 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 16 Mar 2015 19:26:51 +0000 (20:26 +0100)
commit504b65c49c5554dcf8b7da708dc5b9087b2f6b89
treeffa05d93f0d6b6506c88948259e64181d942bbf5
parentb3023c7e839f1462919a6d42b52650d7c4b9bc3b
s3:winbind:pwent: move resetting next_user up.

This does not change the behaviour and makes it more evident
that we have anothe code duplication here:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (state->gstate->num_users == 0) {
...
}

subreq = wb_fill_pwent_send(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

is for the current setting of variables equivalent
to the block found elsewhere:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (state->gstate->next_user >= state->gstate->num_users) {
...
}

subreq = wb_fill_pwent_send(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

because both num_users is set to a non-negative
value and num_users starts at 0 and is incremented up to
num_users.

The code duplication will be factored out next.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/winbindd/wb_next_pwent.c