Skip to content

Commit ee5c5ac

Browse files
authored
nit: do not increase failed_attempts beyond 999 (#369)
fixes #368
1 parent 9e24074 commit ee5c5ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

i3lock.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ static void input_done(void) {
317317
}
318318

319319
auth_state = STATE_AUTH_WRONG;
320-
failed_attempts += 1;
320+
/* The unlock indicator displays the number of failed attempts,
321+
* but caps the attempts to 999, so only increment up to 999. */
322+
if (failed_attempts < 999) {
323+
failed_attempts += 1;
324+
}
321325
clear_input();
322326
if (unlock_indicator) {
323327
redraw_screen();

0 commit comments

Comments
 (0)