Adhemerval Zanella <adhemerval.zanella@linaro.org> writes: >>> + buf[r - 1] = '\0'; >> >> This always overwrites the last byte of the file, shouldn't this be >> buf[r] ? > > Yes, I have fixed it. > > Is this patch ok with the above fix? Yes. Reviewed-by: DJ Delorie <dj@redhat.com>