Fixed a potential crash when an invalid Scancode constant argument is used in love.keyboard.getKeyFromScancode.

This commit is contained in:
Alex Szpakowski
2015-02-14 17:54:25 -04:00
parent 84294ac684
commit ed4c364171
+1 -1
View File
@@ -84,7 +84,7 @@ int w_getKeyFromScancode(lua_State *L)
const char *scancodestr = luaL_checkstring(L, 1);
Keyboard::Scancode scancode;
if (!Keyboard::getConstant(scancodestr, scancode))
return luaL_error(L, "Invalid scancode: %s", scancode);
return luaL_error(L, "Invalid scancode: %s", scancodestr);
Keyboard::Key key = instance()->getKeyFromScancode(scancode);