memory-util: move memzero() to src/fundamental/ to share with UEFI

(and while we are at it, make sure it returns the input pointer as
output)
This commit is contained in:
Lennart Poettering
2023-10-02 15:00:13 +02:00
parent 1e5e902f60
commit 4ac79c2b77
5 changed files with 13 additions and 11 deletions
-7
View File
@@ -47,13 +47,6 @@ static inline int memcmp_nn(const void *s1, size_t n1, const void *s2, size_t n2
?: CMP(n1, n2);
}
#define memzero(x,l) \
({ \
size_t _l_ = (l); \
if (_l_ > 0) \
memset(x, 0, _l_); \
})
#define zero(x) (memzero(&(x), sizeof(x)))
bool memeqbyte(uint8_t byte, const void *data, size_t length);