Ensure key name is null terminated

This commit is contained in:
Kovid Goyal
2019-12-28 08:33:13 +05:30
parent 286f3630d7
commit c8f20d0edf
4 changed files with 3 additions and 3 deletions

View File

@@ -2181,6 +2181,7 @@ GLFWAPI void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun
GLFWAPI void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char cocoa_key[32], int *cocoa_mods) {
*cocoa_mods = 0;
memset(cocoa_key, 0, sizeof(cocoa_key));
if (glfw_mods & GLFW_MOD_SHIFT)
*cocoa_mods |= NSEventModifierFlagShift;

View File

@@ -166,7 +166,7 @@ def generate_wrappers(glfw_header):
GLFWcocoatogglefullscreenfun glfwSetCocoaToggleFullscreenIntercept(GLFWwindow *window, GLFWcocoatogglefullscreenfun callback)
GLFWapplicationshouldhandlereopenfun glfwSetApplicationShouldHandleReopen(GLFWapplicationshouldhandlereopenfun callback)
GLFWapplicationwillfinishlaunchingfun glfwSetApplicationWillFinishLaunching(GLFWapplicationwillfinishlaunchingfun callback)
void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char cocoa_key[32], int* cocoa_mods)
void glfwGetCocoaKeyEquivalent(int glfw_key, int glfw_mods, char[32] cocoa_key, int* cocoa_mods)
void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun callback)
void* glfwGetX11Display(void)
int32_t glfwGetX11Window(GLFWwindow* window)