From e12049ed4769db7907a181a8ded7d349890d118b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 4 Jan 2019 08:10:15 +0000 Subject: [PATCH] Added use of sizeof to make code a bit more flexible --- src/osgViewer/GraphicsWindowX11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 9ee634219..7df251323 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);