mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-09 17:23:50 +01:00
CIrrDeviceLinux: Fix type for NET_WM_PID XChangeProperty
This uses format=32 which in X11's API means a C type of long (with restricted range when > 32 bits). pid_t is of unknown type, though on Linux and FreeBSD it's a 32-bit type, so does not have the same size as long on 64-bit architectures, and thus XChangeProperty reads outside its bounds. Fix this by casting to and passing a long.
This commit is contained in:
parent
d98dc90b38
commit
ef3bab610d
@ -332,7 +332,7 @@ void CIrrDeviceLinux::setupTopLevelXorgWindow()
|
||||
|
||||
Atom NET_WM_PID = XInternAtom(XDisplay, "_NET_WM_PID", false);
|
||||
|
||||
pid_t pid = getpid();
|
||||
long pid = static_cast<long>(getpid());
|
||||
|
||||
XChangeProperty(XDisplay, XWindow, NET_WM_PID,
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
|
Loading…
Reference in New Issue
Block a user