mirror of
https://github.com/sheumann/hush.git
synced 2024-12-25 18:33:06 +00:00
read_key: fix buffer length calculation
Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
36dcf4e516
commit
0358daf447
@ -264,5 +264,5 @@ void FAST_FUNC read_key_ungets(char *buffer, const char *str, unsigned len)
|
||||
if (len > KEYCODE_BUFFER_SIZE-1 - cur_len)
|
||||
len = KEYCODE_BUFFER_SIZE-1 - cur_len;
|
||||
memcpy(buffer + 1 + cur_len, str, len);
|
||||
buffer[0] += cur_len + len;
|
||||
buffer[0] += len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user