X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fresource.c;h=29bfcd7fd0a962fb7c29d6f7621251876bc43e5d;hp=d60f5476ebadd9557e948e6c7e823f5d30e536b5;hb=7bbd03a7f450e59ebd7481cd1af0639131630f42;hpb=761ec06065819eb2af9e2554813f8b87ff48f695 diff --git a/src/resource.c b/src/resource.c index d60f5476..29bfcd7f 100644 --- a/src/resource.c +++ b/src/resource.c @@ -97,8 +97,8 @@ read_compressed_resource(int in_fd, /* Calculate how many chunks the resource consists of in its entirety. * */ - u64 num_chunks = (resource_uncompressed_size + WIM_CHUNK_SIZE - 1) / - WIM_CHUNK_SIZE; + u64 num_chunks = DIV_ROUND_UP(resource_uncompressed_size, WIM_CHUNK_SIZE); + /* As mentioned, the first chunk has no entry in the chunk table. */ u64 num_chunk_entries = num_chunks - 1;