X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Falloc%2Ftiny.c;h=ffd17c65734f881f1ca355ed9e1a5b705dd3ff46;hp=c27c601f5aa1fb59b448ff0dc000af322a5a8bd6;hb=c438ec17d7b2efe76e56e5fc5ab88bd4a02735e8;hpb=1fe93863f1af6085ff7c3b1e0b1774744ee1e2e6;ds=sidebyside 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;