mirror of https://github.com/m-labs/artiq.git
log.c: fix off-by-one error.
This commit is contained in:
parent
30cdb209c6
commit
98bb570aec
|
@ -64,7 +64,7 @@ def main():
|
||||||
comm.check_ident()
|
comm.check_ident()
|
||||||
|
|
||||||
if args.action == "log":
|
if args.action == "log":
|
||||||
print(comm.get_log())
|
print(comm.get_log(), end='')
|
||||||
elif args.action == "cfg-read":
|
elif args.action == "cfg-read":
|
||||||
value = comm.flash_storage_read(args.key)
|
value = comm.flash_storage_read(args.key)
|
||||||
if not value:
|
if not value:
|
||||||
|
|
|
@ -56,7 +56,7 @@ void log_get(char *outbuf)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
j = buffer_index + 1;
|
j = buffer_index;
|
||||||
for(i = 0; i < LOG_BUFFER_SIZE; i++) {
|
for(i = 0; i < LOG_BUFFER_SIZE; i++) {
|
||||||
outbuf[i] = buffer[j];
|
outbuf[i] = buffer[j];
|
||||||
j = (j + 1) % LOG_BUFFER_SIZE;
|
j = (j + 1) % LOG_BUFFER_SIZE;
|
||||||
|
|
Loading…
Reference in New Issue