X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Ffuse-exfat.git;a=blobdiff_plain;f=libexfat%2Fcluster.c;fp=libexfat%2Fcluster.c;h=0f2e91b07317e4bfbb9bc180b180a54021bfa7c3;hp=15cd9aa339da22d8616be9d333c53021cf1ea219;hb=b747352475991e7b96183fa1014937efd3e47187;hpb=5151112c14bb7cdc93bcc66901485d94f2ab0c24 diff --git a/libexfat/cluster.c b/libexfat/cluster.c index 15cd9aa..0f2e91b 100644 --- a/libexfat/cluster.c +++ b/libexfat/cluster.c @@ -122,7 +122,7 @@ static cluster_t find_bit_and_set(bitmap_t* bitmap, size_t start, size_t end) for (i = start_index; i < end_index; i++) { - if (bitmap[i] == ~((bitmap_t) 0)) + if (bitmap[i] == (bitmap_t) ~((bitmap_t) 0)) continue; start_bitindex = MAX(i * sizeof(bitmap_t) * 8, start); end_bitindex = MIN((i + 1) * sizeof(bitmap_t) * 8, end); @@ -280,7 +280,7 @@ static int grow_file(struct exfat* ef, struct exfat_node* node, shrink_file(ef, node, current + allocated, allocated); return -ENOSPC; } - if (next != previous - 1 && node->is_contiguous) + if (next != previous + 1 && node->is_contiguous) { /* it's a pity, but we are not able to keep the file contiguous anymore */