OSDN Git Service

Use DIV_ROUND_UP macro.
[android-x86/external-exfat.git] / fsck / main.c
index ded76b2..cda1965 100644 (file)
@@ -3,7 +3,7 @@
        exFAT file system checker.
 
        Free exFAT implementation.
-       Copyright (C) 2011-2015  Andrew Nayenko
+       Copyright (C) 2011-2016  Andrew Nayenko
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ uint64_t files_count, directories_count;
 static int nodeck(struct exfat* ef, struct exfat_node* node)
 {
        const cluster_t cluster_size = CLUSTER_SIZE(*ef->sb);
-       cluster_t clusters = (node->size + cluster_size - 1) / cluster_size;
+       cluster_t clusters = DIV_ROUND_UP(node->size, cluster_size);
        cluster_t c = node->start_cluster;
        int rc = 0;
 
@@ -147,7 +147,7 @@ int main(int argc, char* argv[])
                switch (opt)
                {
                case 'V':
-                       puts("Copyright (C) 2011-2015  Andrew Nayenko");
+                       puts("Copyright (C) 2011-2016  Andrew Nayenko");
                        return 0;
                default:
                        usage(argv[0]);