STRLCAT_CONST_INCR should be at most 1 statement, so single-line if, for etc work

This commit is contained in:
LazyBumHorse 2019-09-22 20:12:56 +02:00
parent db723df879
commit f309c85f92

View File

@ -56,8 +56,8 @@ static INLINE bool string_is_equal(const char *a, const char *b)
STRLCPY_CONST((buf) + MIN((strlcpy_ret), (buf_size)-1 - STRLEN_CONST((str))), (str))
#define STRLCAT_CONST_INCR(buf, strlcpy_ret, str, buf_size) \
STRLCAT_CONST(buf, strlcpy_ret, str, buf_size); \
(strlcpy_ret) += STRLEN_CONST((str))
do { STRLCAT_CONST(buf, strlcpy_ret, str, buf_size); \
(strlcpy_ret) += STRLEN_CONST((str)); } while(0)
#define string_is_not_equal_fast(a, b, size) (memcmp(a, b, size) != 0)
#define string_is_equal_fast(a, b, size) (memcmp(a, b, size) == 0)