diff options
| author | stderr64 <stderr64@null.net> | 2026-01-27 20:18:13 +0200 |
|---|---|---|
| committer | stderr64 <stderr64@null.net> | 2026-01-27 20:18:13 +0200 |
| commit | a74507daf4df36b1e005b4d9933ece2bae8986a5 (patch) | |
| tree | 466e4301d99902fcc57a5711e31afc6c4c56794a | |
| parent | 6df537403fbfc8d82c3c9e564fa222ca7ba29ff4 (diff) | |
| download | dwmtimestatus-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.
| -rw-r--r-- | dwmtimestatus.c | 4 |
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; } |
