chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35be4ab
)
macro: don't rely on C's downgrade-to-bool feature for numeric comparisons
author
Lennart Poettering
<lennart@poettering.net>
Wed, 11 Apr 2018 19:36:52 +0000
(21:36 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000
(16:47 +0200)
src/basic/macro.h
patch
|
blob
|
history
diff --git
a/src/basic/macro.h
b/src/basic/macro.h
index 6b3c3d04df9e85c997cdf5426547fa1d86288c0b..cd3ae8d3ab734cba17790739dc0e73f783e0c379 100644
(file)
--- 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; \
})