1
mirror of https://github.com/topjohnwu/Magisk synced 2024-11-13 20:54:12 +01:00

Round sizes to nearest integer

This commit is contained in:
topjohnwu 2018-02-12 04:56:50 +08:00
parent 754fafcfe9
commit 7da205f4c8

View File

@ -86,8 +86,8 @@ int get_img_size(const char *img, int *used, int *total) {
}
if (status) continue;
sscanf(tok, "%d/%d", used, total);
*used = *used / 256 + 1;
*total /= 256;
*used = (*used + 255) / 256;
*total = (*total + 128) / 256;
break;
}
}