Skip to content

Commit

Permalink
lib: Created i_zero() wrapper for memset(p, 0, sizeof(*p)).
Browse files Browse the repository at this point in the history
Also creates an i_zero_safe() version for safe_memset().
  • Loading branch information
stephanbosch committed Dec 24, 2016
1 parent 7074600 commit 08cb8e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/macros.h
Expand Up @@ -231,4 +231,8 @@
# define STATIC_ARRAY
#endif

/* Convenience wrappers for initializing a struct */
#define i_zero(p) memset(p, 0, sizeof(*(p)))
#define i_zero_safe(p) safe_memset(p, 0, sizeof(*(p)))

#endif

0 comments on commit 08cb8e0

Please sign in to comment.