[syslinux:master] diag/geodsp: fix ordering of args to fread/fwrite in mk-lba-img

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon Apr 25 14:30:34 PDT 2011


Commit-ID:  b69866a20179104349d3da48663d33faf4575a1a
Gitweb:     http://syslinux.zytor.com/commit/b69866a20179104349d3da48663d33faf4575a1a
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 25 Apr 2011 14:27:28 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 25 Apr 2011 14:27:28 -0700

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 <hpa at zytor.com>


---
 diag/geodsp/mk-lba-img.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

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++;
 	}
 



More information about the Syslinux-commits mailing list