]> arthur.barton.de Git - bup.git/commitdiff
Make split condition depend on ~0, not 0.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 29 Dec 2009 18:07:22 +0000 (13:07 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 29 Dec 2009 18:07:22 +0000 (13:07 -0500)
Otherwise we could end up splitting on one-byte blocks, which is pretty
dumb.

hashsplit.c

index 3b764f2cafb654ec72d652d752237ececa36af29..60ba30218abfd27ea6926f23085206cb84534bd2 100644 (file)
@@ -70,7 +70,7 @@ int main()
        i = (i + 1) % WINDOWSIZE;
        count++;
        
-       if ((sum & (BLOBSIZE-1)) == 0)
+       if ((sum & (BLOBSIZE-1)) == ((~0) & (BLOBSIZE-1)))
        {
            fprintf(stderr, "SPLIT @ %-8d size=%-8d (%d/%d)\n",
                    count, count - last_count, BLOBSIZE, WINDOWSIZE);