]> git.armaanb.net Git - slock.git/commit
Properly clear the last entered character
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 25 Mar 2017 20:16:01 +0000 (21:16 +0100)
committerMarkus Teich <teichm@fs.tum.de>
Sat, 25 Mar 2017 20:51:29 +0000 (21:51 +0100)
commit35633d45672d14bd798c478c45d1a17064701aa9
treecfd18c8b5ddb6738b59174cf91a9a8421ac48713
parent2d2a21a90ad1b53594b1b90b97486189ec54afce
Properly clear the last entered character

When enter is pressed, passwd[len] will be set to '\0'. Pressing
backspace is supposed to remove the last entered character.

But currently, the clearing has an off-by-one, as in setting
passwd[len] to '\0' just like enter would do.

You can also verify it by imagining len=1 and that it's impossible to
clear passwd[0] by pressing backspace with the current code.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
slock.c