1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Fix braino in gtkask.c loop conditions.

If you're counting up to ms_limit in steps of ms_step, it's silly to
add ms_step at the end of the loop body _and_ increment the loop
variable by 1 in the loop header. I must have been half asleep.
This commit is contained in:
Simon Tatham 2015-07-28 18:49:23 +01:00
parent 65f3500906
commit 4eddcb4c56

View File

@ -176,11 +176,10 @@ static int repeatedly_try_grab(struct askpass_ctx *ctx, try_grab_fn_t fn)
const useconds_t ms_step = 1000000/8; /* at 1/8 second intervals */
useconds_t ms;
for (ms = 0; ms < ms_limit; ms++) {
for (ms = 0; ms < ms_limit; ms += ms_step) {
if (fn(ctx))
return TRUE;
usleep(ms_step);
ms += ms_step;
}
return FALSE;
}