From a88b17565bd98f2a5112e7e05ed1507c15c996f0 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 26 Feb 2025 11:43:20 +0100 Subject: [PATCH] xkb: maprules: use static struct init instead of memset() Allow the compiler to figure out the most efficient way to do the struct initialization, and a little improvement on code readability. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- xkb/maprules.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xkb/maprules.c b/xkb/maprules.c index fe064fd14..b5bdfefc3 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -376,7 +376,6 @@ CheckLine(InputLine * line, { char *str, *tok; register int nread; - FileSpec tmp; _Xstrtokparams strtok_buf; Bool append = FALSE; @@ -419,7 +418,9 @@ CheckLine(InputLine * line, DebugF("Illegal line of data ignored\n"); return FALSE; } - memset((char *) &tmp, 0, sizeof(FileSpec)); + + FileSpec tmp = { 0 }; + str = line->line; for (nread = 0; (tok = _XStrtok(str, " ", strtok_buf)) != NULL; nread++) { str = NULL;