diff options
Diffstat (limited to 'src/commonlib/include')
-rw-r--r-- | src/commonlib/include/commonlib/endian.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commonlib/include/commonlib/endian.h b/src/commonlib/include/commonlib/endian.h index 1ec472f5d2..7b08eee7af 100644 --- a/src/commonlib/include/commonlib/endian.h +++ b/src/commonlib/include/commonlib/endian.h @@ -18,6 +18,7 @@ #include <stddef.h> #include <stdint.h> +#include <string.h> /* Endian agnostic functions working on single byte. */ @@ -254,4 +255,9 @@ static inline void write_at_le64(void *dest, uint64_t val, size_t offset) write_le64(d, val); } +static inline void zero_n(void *dest, size_t n) +{ + memset(dest, 0, n); +} + #endif |