Added use of sizeof to make code a bit more flexible

This commit is contained in:
Robert Osfield 2019-01-04 08:10:15 +00:00
parent 49cf25718c
commit 7efe889537

View File

@ -1770,7 +1770,7 @@ void GraphicsWindowX11::transformMouseXY(float& x, float& y)
void GraphicsWindowX11::adaptKey(XKeyEvent& keyevent, int& keySymbol, int& unmodifiedKeySymbol) void GraphicsWindowX11::adaptKey(XKeyEvent& keyevent, int& keySymbol, int& unmodifiedKeySymbol)
{ {
unsigned char buffer_return[32]; unsigned char buffer_return[32];
int bytes_buffer = 32; int bytes_buffer = sizeof(buffer_return);
KeySym keysym_return; KeySym keysym_return;
int numChars = XLookupString(&keyevent, reinterpret_cast<char*>(buffer_return), bytes_buffer, &keysym_return, NULL); int numChars = XLookupString(&keyevent, reinterpret_cast<char*>(buffer_return), bytes_buffer, &keysym_return, NULL);