diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 453d38829..67f7c6f40 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -1770,7 +1770,7 @@ void GraphicsWindowX11::transformMouseXY(float& x, float& y) void GraphicsWindowX11::adaptKey(XKeyEvent& keyevent, int& keySymbol, int& unmodifiedKeySymbol) { unsigned char buffer_return[32]; - int bytes_buffer = 32; + int bytes_buffer = sizeof(buffer_return); KeySym keysym_return; int numChars = XLookupString(&keyevent, reinterpret_cast(buffer_return), bytes_buffer, &keysym_return, NULL);