commit | a68ee40e5d10bc5f41842e38fde2471f4d3fb6bf | [log] [tgz] |
---|---|---|
author | Nico Huber <nico.huber@secunet.com> | Tue Jan 23 16:17:36 2024 +0100 |
committer | Nico Huber <nico.huber@secunet.com> | Tue Jan 23 16:17:36 2024 +0100 |
tree | c6aaf41eaaf7b184c319adf80034b3200bc19624 | |
parent | a0b1178f569275912d7cf7c9af6eb4c03d14995a [diff] |
Fix devread(): fread() returns the number of elements, not bytes
diff --git a/src/blockdev.c b/src/blockdev.c index d3c2a48..2395c45 100644 --- a/src/blockdev.c +++ b/src/blockdev.c
@@ -66,7 +66,7 @@ fprintf(stderr, "devread: Failed to set offset on device.\n"); return 0; } - if (fread(buf, byte_len, 1, block_device) != byte_len) { + if (fread(buf, byte_len, 1, block_device) != 1) { fprintf(stderr, "devread: Failed to read from device.\n"); return 0; }