Fix ASSERT() macro with '%' in the expression

commit 4bd7008291
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Fix a compiling error triggered by ASSERT(exp), when exp contains '%'

(e.g. integer modular operator)

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Robin Hsu 2020-11-04 11:13:08 +08:00 committed by dongsenhao
parent ad9ff71f6f
commit da760b34ae

View File

@ -194,8 +194,8 @@ static inline uint64_t bswap_64(uint64_t val)
#define ASSERT(exp) \
do { \
if (!(exp)) { \
printf("[ASSERT] (%s:%4d) " #exp"\n", \
__func__, __LINE__); \
printf("[ASSERT] (%s:%4d) %s\n", \
__func__, __LINE__, #exp); \
exit(-1); \
} \
} while (0)