Commit 5d937779 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Fix up reading of saved log files

Make sure we compensate for sizeof(int) and the stuff we have already
read.

Fixes: #848
parent c3aac583
......@@ -165,7 +165,7 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
vsl->rbuflen = l;
}
i = read(vsl->r_fd, vsl->rbuf + 2, l * 4L - 8L);
if (i != l)
if (i != (l * 4L - 8L))
return (-1);
*pp = vsl->rbuf;
return (1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment