* src/xterm.c (x_display_set_last_user_time): Adjust for Xlib
sign extending fields in client messages to 64 bit long, which
then break x_display_set_last_user_time after 24 days, as Time
is unsigned long for historical reasons. (bug#59480)
old_time = dpyinfo->last_user_time;
#endif
+ /* Time can be sign extended if retrieved from a client message.
+ Make sure it is always 32 bits, or systems with 64-bit longs
+ will crash after 24 days of X server uptime. (bug#59480) */
+ time &= X_ULONG_MAX;
+
#ifdef ENABLE_CHECKING
eassert (time <= X_ULONG_MAX);
#endif