Skip to content

Commit

Permalink
Round sizes to nearest integer
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Feb 11, 2018
1 parent 754fafc commit 7da205f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native/jni/utils/img.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7da205f

Please sign in to comment.