summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-02-29 11:13:27 -0800
committerVic Yang <victoryang@chromium.org>2012-02-29 11:13:27 -0800
commitd1e627926f7cdad2ee2428a3cfe3c64cf959afde (patch)
treedb56034fa8568e731e63ec75dec8967c494b54f4 /common
parent13b5c41951c2da3e90ac115a3dbe8aaddb959782 (diff)
downloadchrome-ec-d1e627926f7cdad2ee2428a3cfe3c64cf959afde.tar.gz
Fix a bug causing console history to miss a character.
If the last command is saved at the beginning of the buffer, loading this command will lead to a character missing. Signed-off-by: Vic Yang <victoryang@chromium.org> BUG=chrome-os-partner:8261 TEST=Manual Change-Id: I0afd4a264f342137955075fe2950444691f79d35
Diffstat (limited to 'common')
-rw-r--r--common/uart_buffering.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c
index 4706ce895d..6eea74329a 100644
--- a/common/uart_buffering.c
+++ b/common/uart_buffering.c
@@ -197,7 +197,7 @@ static void history_save(void)
if (hist_id == cmd_history_tail)
tail = 0;
else
- tail = cmd_history[CMD_HIST_PREV(hist_id)].head + 1;
+ tail = RX_BUF_NEXT(cmd_history[CMD_HIST_PREV(hist_id)].head);
head = tail;
for (ptr = 0; ptr < rx_cur_buf_head; ++ptr, head = RX_BUF_NEXT(head))
rx_buf[head] = rx_cur_buf[ptr];