From: H. Peter Anvin Date: Mon, 25 Apr 2011 21:27:28 +0000 (-0700) Subject: diag/geodsp: fix ordering of args to fread/fwrite in mk-lba-img X-Git-Tag: syslinux-4.05-pre1~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b69866a20179104349d3da48663d33faf4575a1a;p=profile%2Fivi%2Fsyslinux.git diag/geodsp: fix ordering of args to fread/fwrite in mk-lba-img If we want the return value to be in bytes, make sure we pass the byte count in the nmemb field instead of the size field. Signed-off-by: H. Peter Anvin --- diff --git a/diag/geodsp/mk-lba-img.c b/diag/geodsp/mk-lba-img.c index 9de6624..ed5a7ed 100644 --- a/diag/geodsp/mk-lba-img.c +++ b/diag/geodsp/mk-lba-img.c @@ -67,10 +67,10 @@ int main(int argc, char *argv[]) } lba = 0; - while ((len = fread(b, BPS, 1, stdin))) { + while ((len = fread(b, 1, BPS, stdin))) { if (len < BPS) memset((char *)b + len, 0, BPS - len); - fwrite(b, BPS, 1, f); + fwrite(b, 1, BPS, f); lba++; } @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) for (i = 0; i < SECT_INT; i++) b[i] = lba; } - fwrite(b, BPS, 1, f); + fwrite(b, 1, BPS, f); lba++; }