From: Lennart Poettering Date: Wed, 11 Apr 2018 19:36:52 +0000 (+0200) Subject: macro: don't rely on C's downgrade-to-bool feature for numeric comparisons X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a8593f31bbf22793a2006616c2c91a2a0522a063;p=elogind.git macro: don't rely on C's downgrade-to-bool feature for numeric comparisons --- diff --git a/src/basic/macro.h b/src/basic/macro.h index 6b3c3d04d..cd3ae8d3a 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -350,7 +350,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { ({ \ typeof(x) _x_ = (x); \ unsigned ans = 1; \ - while (_x_ /= 10) \ + while ((_x_ /= 10) != 0) \ ans++; \ ans; \ })