X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Falloc%2Ftiny.c;h=ffd17c65734f881f1ca355ed9e1a5b705dd3ff46;hb=50212d0d271f967d9f5d14c116ec54c0050882a8;hp=c27c601f5aa1fb59b448ff0dc000af322a5a8bd6;hpb=1fe93863f1af6085ff7c3b1e0b1774744ee1e2e6;p=ccan diff --git a/ccan/alloc/tiny.c b/ccan/alloc/tiny.c index c27c601f..ffd17c65 100644 --- a/ccan/alloc/tiny.c +++ b/ccan/alloc/tiny.c @@ -1,3 +1,4 @@ +/* Licensed under LGPLv2.1+ - see LICENSE file for details */ #include "tiny.h" #include "bitops.h" #include @@ -19,7 +20,7 @@ /* Val is usually offset by MIN_BLOCK_SIZE here. */ static unsigned encode_length(unsigned long val) { - unsigned int bits = fls(val); + unsigned int bits = afls(val); /* 5 bits in first byte. */ if (bits <= 5) return 1;