[git commit master] read_key: fix buffer length calculation

Denys Vlasenko vda.linux at googlemail.com
Fri Apr 16 23:26:08 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=0358daf44742385f2eac355cd2605a1993628343
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Tomas Heinrich <heinrich.tomas at gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/read_key.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libbb/read_key.c b/libbb/read_key.c
index 0faa12c..8422976 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;
 }
-- 
1.6.3.3



More information about the busybox-cvs mailing list