From e3f4c754edc461a04a679d0d52dedc2be718ad06 Mon Sep 17 00:00:00 2001 From: stderr64 Date: Thu, 11 Jun 2026 15:52:28 +0300 Subject: Only initialize current_status struct once with memset --- .gitignore | 1 + dwmtimestatus.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1377554..1d89776 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +dwmtimestatus *.swp diff --git a/dwmtimestatus.c b/dwmtimestatus.c index 3408e8c..3bf0fda 100644 --- a/dwmtimestatus.c +++ b/dwmtimestatus.c @@ -102,7 +102,7 @@ int main( int argc, char **args ){ assert( sigaction(SIGINT, (const struct sigaction*)s_act, NULL) != -1 ); assert( sigaction(SIGTERM, (const struct sigaction*)s_act, NULL) != -1 ); assert( sigaction(SIGPIPE, (const struct sigaction*)s_act, NULL) != -1 ); - struct status current_status = {0}; + struct status current_status; memset( (void*)¤t_status, 0, sizeof(struct status) ); const char *optstring = "i:d:f:"; int opt_char = 0; -- cgit v1.3.1-10-gc9f91