b58tobin: Simplify zeromask calculation (fixes bug encountered when compiling with LLVM)

This commit is contained in:
Luke Dashjr
2014-09-16 02:39:55 +00:00
parent 06e594e37f
commit 6d2d2c5f0e

View File

@@ -40,7 +40,7 @@ bool b58tobin(void *bin, size_t *binszp, const char *b58, size_t b58sz)
uint32_t c; uint32_t c;
size_t i, j; size_t i, j;
uint8_t bytesleft = binsz % 4; uint8_t bytesleft = binsz % 4;
uint32_t zeromask = ~((1 << ((bytesleft ?: 4) * 8)) - 1); uint32_t zeromask = bytesleft ? (0xffffffff << (bytesleft * 8)) : 0;
unsigned zerocount = 0; unsigned zerocount = 0;
if (!b58sz) if (!b58sz)