diff options
author | Simon Ser <contact@emersion.fr> | 2023-07-07 14:34:56 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-07-07 17:31:11 +0200 |
commit | 7a9f8d8d6bf72fcea210552b7bec9b99f342f857 (patch) | |
tree | c84c622b9ea25646c081f81b534ec7c70b84ac84 /CONTRIBUTING.md | |
parent | 4966857f211cb6f48852928076a59f16aadb742b (diff) |
Use struct initializers instead of memset()
This is a bit more type-safe.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9b79834..2c234273 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -197,8 +197,8 @@ Functions that are responsible for constructing objects should take one of the two following forms: * `init`: for functions which accept a pointer to a pre-allocated object (e.g. -a member of a struct) and initialize it. Such functions must call `memset()` -to zero out the memory before initializing it to avoid leaving unset fields. +a member of a struct) and initialize it. Such functions must zero out the +memory before initializing it to avoid leaving unset fields. * `create`: for functions which allocate the memory for an object, initialize it, and return a pointer. Such functions should allocate the memory with `calloc()` to avoid leaving unset fields. |