From a74507daf4df36b1e005b4d9933ece2bae8986a5 Mon Sep 17 00:00:00 2001 From: stderr64 Date: Tue, 27 Jan 2026 20:18:13 +0200 Subject: Check for any error returned by XChangeProperty an not only BadLength. XChangeProperty can return BadLength or BadValue, not just BadLngth which was the only one checked for previously. BadValue is returned in case where format is not 8, 16, or 32. --- dwmtimestatus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dwmtimestatus.c') diff --git a/dwmtimestatus.c b/dwmtimestatus.c index 90b453a..3db504c 100644 --- a/dwmtimestatus.c +++ b/dwmtimestatus.c @@ -49,8 +49,8 @@ void sighandler( int si_code, siginfo_t *si_info, void *si_adr ){ void update_status( struct status *status_info ){ if ( status_info == NULL ) return; - if ( XChangeProperty(status_info->dpy, status_info->root, XA_WM_NAME, XA_STRING, 8, PropModeReplace, (_Xconst unsigned char*)&status_info->status, status_info->status_len) == BadLength ) - fputs( "Error: XChangeProperty returned BadLength\n", stderr ); + if ( XChangeProperty(status_info->dpy, status_info->root, XA_WM_NAME, XA_STRING, 8, PropModeReplace, (_Xconst unsigned char*)&status_info->status, status_info->status_len) != 1 ) + fputs( "Error: XChangeProperty() failed\n", stderr ); XSync( status_info->dpy, 0 ); return; } -- cgit v1.2.3-96-g3da7