diff options
| author | stderr64 <stderr64@null.net> | 2026-01-25 19:25:36 +0200 |
|---|---|---|
| committer | stderr64 <stderr64@null.net> | 2026-01-25 19:25:36 +0200 |
| commit | 16d1d814fb686a78565e6be66f02de383fc039bd (patch) | |
| tree | 4a2853da26b3b45d30609abdf68eae71779f1e89 /dwmtimestatus.c | |
| parent | fc8ff5392be9b0da93aab7533cba0fbcd05dce76 (diff) | |
| download | dwmtimestatus-16d1d814fb686a78565e6be66f02de383fc039bd.tar.gz dwmtimestatus-16d1d814fb686a78565e6be66f02de383fc039bd.tar.zst | |
Better initialization of XTextProperty struct
Diffstat (limited to 'dwmtimestatus.c')
| -rw-r--r-- | dwmtimestatus.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dwmtimestatus.c b/dwmtimestatus.c index cd5c879..044e9e7 100644 --- a/dwmtimestatus.c +++ b/dwmtimestatus.c @@ -23,7 +23,12 @@ struct status{ struct sigaction *s_act = NULL; struct status current_status = {0}; -XTextProperty status_props = {0}; +XTextProperty status_props = { + .value = (unsigned char*)¤t_status.status, + .encoding = XA_STRING, + .format = 8, + .nitems = 0 +}; void sighandler( int si_code, siginfo_t *si_info, void *si_adr ){ int exit_status = EXIT_SUCCESS; @@ -103,10 +108,6 @@ int main( int argc, char **args ){ assert( sigaction(SIGTERM, (const struct sigaction*)s_act, NULL) != -1 ); assert( sigaction(SIGPIPE, (const struct sigaction*)s_act, NULL) != -1 ); memset( (void*)¤t_status, 0, sizeof(struct status) ); - memset( (void*)&status_props, 0, sizeof(XTextProperty) ); - status_props.value = (unsigned char*)¤t_status.status; - status_props.encoding = XA_STRING; - status_props.format = 8; const char *optstring = "i:d:f:"; int opt_char = 0; while ( (opt_char = getopt(argc, args, optstring)) != -1 ){ |
