From 0358daf44742385f2eac355cd2605a1993628343 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Fri, 16 Apr 2010 23:59:51 +0200 Subject: [PATCH] read_key: fix buffer length calculation Signed-off-by: Tomas Heinrich Signed-off-by: Denys Vlasenko --- libbb/read_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbb/read_key.c b/libbb/read_key.c index 0faa12c97..8422976c9 100644 --- a/libbb/read_key.c +++ b/libbb/read_key.c @@ -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; }