Use BLOCK_SIZE
diff --git a/src/filo-blockdev.adb b/src/filo-blockdev.adb
index e0c4ebb..8658e05 100644
--- a/src/filo-blockdev.adb
+++ b/src/filo-blockdev.adb
@@ -7,8 +7,8 @@
is
use Interfaces.C;
- Sector : constant unsigned_long := unsigned_long (Offset / 512);
- Byte_Offset : constant unsigned_long := unsigned_long (Offset rem 512);
+ Sector : constant unsigned_long := unsigned_long (Offset / BLOCK_SIZE);
+ Byte_Offset : constant unsigned_long := unsigned_long (Offset rem BLOCK_SIZE);
Byte_Len : constant unsigned_long := unsigned_long (Buffer'Length);
Buf : constant System.Address := Buffer'Address;
@@ -19,7 +19,7 @@
begin
-- With 32-bit longs, the current C interface
-- can't access more than 512 * 2 ** 32:
- if Offset / 512 > Blockdev_Length (unsigned_long'last) then
+ if Offset / BLOCK_SIZE > Blockdev_Length (unsigned_long'last) then
Success := False;
return;
end if;