Express C code `part_length' in 512B blocks (as FILO does)
Signed-off-by: Nico Huber <nico.huber@secunet.com>
diff --git a/src/blockdev.c b/src/blockdev.c
index 2395c45..91879c4 100644
--- a/src/blockdev.c
+++ b/src/blockdev.c
@@ -32,7 +32,7 @@
}
part_start = 0;
- part_length = device_size;
+ part_length = device_size / 512;
return 1;
}
@@ -79,13 +79,13 @@
{
if (start + size <= device_size) {
part_start = start;
- part_length = size;
+ part_length = size / 512;
}
}
void dev_get_partition(unsigned long *start, unsigned long *size)
{
*start = part_start;
- *size = part_length;
+ *size = part_length * 512;
}