memory-util: replace memeqzero() by a more generic memeqbyte()

The new helper can check for any byte, no just zeroes. The old name is
then converted into a macro that wraps our new version of the helper.
This commit is contained in:
Lennart Poettering
2021-09-13 12:48:27 +02:00
parent 503994bada
commit 3f9992d82e
2 changed files with 9 additions and 8 deletions
+3 -1
View File
@@ -47,7 +47,9 @@ static inline int memcmp_nn(const void *s1, size_t n1, const void *s2, size_t n2
#define zero(x) (memzero(&(x), sizeof(x)))
bool memeqzero(const void *data, size_t length);
bool memeqbyte(uint8_t byte, const void *data, size_t length);
#define memeqzero(data, length) memeqbyte(0x00, data, length)
#define eqzero(x) memeqzero(x, sizeof(x))