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 authored and sirainen committed Dec 28, 2016
1 parent 15964b7 commit 365096b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/macros.h
Expand Up @@ -240,4 +240,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 365096b

Please sign in to comment.