shithub: npe

Download patch

ref: ebf07866d4c0be18dd2a7dd623e9458220e5ebb1
parent: 31984582c702a9febde8773e1e24f305c4eceae4
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Mar 16 09:23:51 EDT 2021

sdl2: define and use SDL_TEXTINPUTEVENT_TEXT_SIZE for text input events

--- a/include/npe/SDL2/SDL.h
+++ b/include/npe/SDL2/SDL.h
@@ -159,6 +159,8 @@
 	SDL_TEXTUREACCESS_STATIC = 0,
 	SDL_RENDERER_ACCELERATED = 0,
 	SDL_RENDERER_PRESENTVSYNC = 0,
+
+	SDL_TEXTINPUTEVENT_TEXT_SIZE = UTFmax,
 };
 
 enum {
@@ -411,7 +413,7 @@
 			int x, y;
 		}motion;
 		struct {
-			char text[UTFmax+1];
+			char text[SDL_TEXTINPUTEVENT_TEXT_SIZE+1];
 		}text;
 		struct {
 			int x, y;