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>
}
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++;
}
for (i = 0; i < SECT_INT; i++)
b[i] = lba;
}
- fwrite(b, BPS, 1, f);
+ fwrite(b, 1, BPS, f);
lba++;
}