From 7da205f4c8d80b375f6ed728ea1f6991349149d3 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 12 Feb 2018 04:56:50 +0800 Subject: [PATCH] Round sizes to nearest integer --- native/jni/utils/img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/jni/utils/img.c b/native/jni/utils/img.c index 4adabd288..9c905de35 100644 --- a/native/jni/utils/img.c +++ b/native/jni/utils/img.c @@ -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; } }