summaryrefslogtreecommitdiff
path: root/dwmtimestatus.c
diff options
context:
space:
mode:
authorstderr64 <stderr64@null.net>2026-01-27 20:18:13 +0200
committerstderr64 <stderr64@null.net>2026-01-27 20:18:13 +0200
commita74507daf4df36b1e005b4d9933ece2bae8986a5 (patch)
tree466e4301d99902fcc57a5711e31afc6c4c56794a /dwmtimestatus.c
parent6df537403fbfc8d82c3c9e564fa222ca7ba29ff4 (diff)
downloaddwmtimestatus-a74507daf4df36b1e005b4d9933ece2bae8986a5.tar.gz
dwmtimestatus-a74507daf4df36b1e005b4d9933ece2bae8986a5.tar.zst
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.
Diffstat (limited to 'dwmtimestatus.c')
-rw-r--r--dwmtimestatus.c4
1 files changed, 2 insertions, 2 deletions
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;
}