mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +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:
parent
65f3500906
commit
4eddcb4c56
@ -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 */
|
const useconds_t ms_step = 1000000/8; /* at 1/8 second intervals */
|
||||||
useconds_t ms;
|
useconds_t ms;
|
||||||
|
|
||||||
for (ms = 0; ms < ms_limit; ms++) {
|
for (ms = 0; ms < ms_limit; ms += ms_step) {
|
||||||
if (fn(ctx))
|
if (fn(ctx))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
usleep(ms_step);
|
usleep(ms_step);
|
||||||
ms += ms_step;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user