mirror of https://github.com/encounter/SDL.git
testmessage: Fix overread of stack variable
This commit is contained in:
parent
fbe810070b
commit
eb98ff4740
|
@ -61,9 +61,9 @@ button_messagebox(void *eventNumber)
|
||||||
if (success == -1) {
|
if (success == -1) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||||
if (eventNumber) {
|
if (eventNumber) {
|
||||||
SDL_UserEvent event;
|
SDL_Event event;
|
||||||
event.type = (intptr_t)eventNumber;
|
event.type = (intptr_t)eventNumber;
|
||||||
SDL_PushEvent((SDL_Event*)&event);
|
SDL_PushEvent(&event);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
quit(2);
|
quit(2);
|
||||||
|
@ -72,9 +72,9 @@ button_messagebox(void *eventNumber)
|
||||||
SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK");
|
SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK");
|
||||||
|
|
||||||
if (eventNumber) {
|
if (eventNumber) {
|
||||||
SDL_UserEvent event;
|
SDL_Event event;
|
||||||
event.type = (intptr_t)eventNumber;
|
event.type = (intptr_t)eventNumber;
|
||||||
SDL_PushEvent((SDL_Event*)&event);
|
SDL_PushEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue