aboutsummaryrefslogtreecommitdiff
path: root/src/keyboard
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 19:50:32 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 20:00:27 +0200
commitb53db6f005b6a7d3b27a96a581dec7fdfe5b6d58 (patch)
tree21cfe94c7718087ffa23ce5f505bccdbe7363a3e /src/keyboard
parentcbe7ca6fcadc28c331a4df0aa6c6d2dea8db8c4e (diff)
downloadjancity-b53db6f005b6a7d3b27a96a581dec7fdfe5b6d58.tar.gz
Deprecate memset(3) over C99 compound literals for zero-init
Using memset(3) does not ensure pointers are assigned to NULL for all platforms.
Diffstat (limited to 'src/keyboard')
-rw-r--r--src/keyboard/src/keyboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/keyboard/src/keyboard.c b/src/keyboard/src/keyboard.c
index c247b16..958ac65 100644
--- a/src/keyboard/src/keyboard.c
+++ b/src/keyboard/src/keyboard.c
@@ -53,7 +53,7 @@ bool keyboard_justpressed(const struct keyboard *const k,
void keyboard_init(struct keyboard *const k)
{
- memset(k, 0, sizeof *k);
+ *k = (const struct keyboard){0};
}
const char *keyboard_key_str(const enum keyboard_key k)