]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/memory-util: do not "return" anything from memzero() macro
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 May 2019 20:49:00 +0000 (22:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 May 2019 20:55:32 +0000 (22:55 +0200)
The macro is not used in expressions, so we don't need the ternary statement.

src/basic/memory-util.h

index 915c24a5ddeb4eec8bec2600e346696397364cdf..0e8957b7838ed84f45878c042b9dab963d56ff52 100644 (file)
@@ -37,8 +37,8 @@ static inline int memcmp_nn(const void *s1, size_t n1, const void *s2, size_t n2
 #define memzero(x,l)                                            \
         ({                                                      \
                 size_t _l_ = (l);                               \
-                void *_x_ = (x);                                \
-                _l_ == 0 ? _x_ : memset(_x_, 0, _l_);           \
+                if (_l_ > 0)                                    \
+                        memset(x, 0, _l_);                      \
         })
 
 #define zero(x) (memzero(&(x), sizeof(x)))