OSDN Git Service

Add assertion.
authorrelan <relan@users.noreply.github.com>
Sat, 21 Aug 2010 08:02:07 +0000 (08:02 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:12 +0000 (08:26 +0300)
libexfat/cluster.c

index 5dae25f..0f2d76a 100644 (file)
@@ -361,6 +361,9 @@ int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size)
        uint32_t c2 = bytes2clusters(ef, size);
        int rc = 0;
 
+       if (node->references == 0 && node->parent)
+               exfat_bug("no references, node changes can be lost");
+
        if (node->size == size)
                return 0;