diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-04-25 14:27:28 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-04-25 14:27:28 -0700 |
commit | b69866a20179104349d3da48663d33faf4575a1a (patch) | |
tree | 3752be3d06ec939aecdedafa58427bc0d9550241 /diag | |
parent | 5d138981b4666d39963dfeca0f1f33fcb16e26f0 (diff) | |
download | syslinux-b69866a20179104349d3da48663d33faf4575a1a.tar.gz syslinux-b69866a20179104349d3da48663d33faf4575a1a.tar.xz syslinux-b69866a20179104349d3da48663d33faf4575a1a.zip |
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@zytor.com>
Diffstat (limited to 'diag')
-rw-r--r-- | 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 9de6624e..ed5a7ed5 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++; } |