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
commitf938bb790eea27a4ae9db6fe0f6f0300a1e1ae86 (patch)
tree8504a04d90d7296b4562d59803a1b57c899b54e6 /src/keyboard
parenteee1205446e3b1832b256dfebac66f0a0f42e528 (diff)
downloadrts-f938bb790eea27a4ae9db6fe0f6f0300a1e1ae86.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)