swaylock: fix clear_password_buffer

This commit is contained in:
espkk 2018-10-14 07:40:33 +03:00
parent 71aaa7e130
commit 42f72f8bb4

View file

@ -14,7 +14,7 @@ void clear_password_buffer(struct swaylock_password *pw) {
// Use volatile keyword so so compiler can't optimize this out.
volatile char *buffer = pw->buffer;
volatile char zero = '\0';
for (size_t i = 0; i < sizeof(buffer); ++i) {
for (size_t i = 0; i < sizeof(pw->buffer); ++i) {
buffer[i] = zero;
}
pw->len = 0;