From: Heiko Schocher Date: Thu, 16 Feb 2012 01:02:21 +0000 (+0000) Subject: command, log: print with "log show" a full logbuffer X-Git-Tag: v2012.04-rc1~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c16a123fd34256859efc789b0bcde3e029b0d12a;p=u-boot command, log: print with "log show" a full logbuffer If the logbuffer contains LOGBUFF_LEN chars, they never got printed with the "log show" command, because chars get printed with the following for loop: for (i = 0; i < (size & LOGBUFF_MASK); i++) { with size = LOGBUFF_LEN and LOGBUFF_MASK = (LOGBUFF_LEN-1) for loop never executed ... Fix this. Signed-off-by: Heiko Schocher Acked-by: Detlev Zundel Fixed merge conflict. Signed-off-by: Wolfgang Denk --- diff --git a/common/cmd_log.c b/common/cmd_log.c index f9fbe002c6..9a3fdc3a49 100644 --- a/common/cmd_log.c +++ b/common/cmd_log.c @@ -219,7 +219,9 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) start = log->v1.start; size = log->v1.size; } - for (i=0; i < (size&LOGBUFF_MASK); i++) { + if (size > LOGBUFF_LEN) + size = LOGBUFF_LEN; + for (i = 0; i < size; i++) { s = lbuf+((start+i)&LOGBUFF_MASK); putc (*s); }