From 3135369cffd78e31b795697ba3167e282f429a19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 30 May 2019 22:49:00 +0200 Subject: [PATCH] basic/memory-util: do not "return" anything from memzero() macro The macro is not used in expressions, so we don't need the ternary statement. --- src/basic/memory-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/memory-util.h b/src/basic/memory-util.h index 915c24a5dd..0e8957b783 100644 --- a/src/basic/memory-util.h +++ b/src/basic/memory-util.h @@ -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))) -- 2.25.1