Skip to content

Commit

Permalink
fix zero width error (qemu#9)
Browse files Browse the repository at this point in the history
Sometimes protobuf calls us with a request to write an element of zero
size. The check will fail in this case.
  • Loading branch information
ivg authored Jun 14, 2016
1 parent ddf6e03 commit dd23ceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracewrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static char target_path[PATH_MAX] = "unknown";
#define WRITE_BUF(x,n) do { \
if (!file) \
err(1, "qemu_trace is not initialized"); \
if (fwrite((x),(n),1,file) != 1) \
if (fwrite((x),1,(n),file) != n) \
err(1, "fwrite failed"); \
} while(0)

Expand Down

0 comments on commit dd23ceb

Please sign in to comment.