forked from M-Labs/artiq
1
0
Fork 0

log.c: fix off-by-one error.

This commit is contained in:
whitequark 2015-08-28 03:06:40 -05:00
parent 30cdb209c6
commit 98bb570aec
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ def main():
comm.check_ident()
if args.action == "log":
print(comm.get_log())
print(comm.get_log(), end='')
elif args.action == "cfg-read":
value = comm.flash_storage_read(args.key)
if not value:

View File

@ -56,8 +56,8 @@ void log_get(char *outbuf)
{
int i, j;
j = buffer_index + 1;
for(i=0;i<LOG_BUFFER_SIZE;i++) {
j = buffer_index;
for(i = 0; i < LOG_BUFFER_SIZE; i++) {
outbuf[i] = buffer[j];
j = (j + 1) % LOG_BUFFER_SIZE;
}