Add some SDL_SetError() calls to the dollar gesture code (thanks, Martin!). Fixes Bugzilla #2673.
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index 46a5546..28b85ad 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -184,7 +184,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
int index = -1;
int i = 0;
if (inTouch == NULL) {
- if (SDL_numGestureTouches == 0) return -1;
+ if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered");
for (i = 0; i < SDL_numGestureTouches; i++) {
inTouch = &SDL_gestureTouch[i];
index = SDL_AddDollarGesture_one(inTouch, path);
@@ -206,7 +206,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
for (i = 0; i < SDL_numGestureTouches; i++)
if (SDL_gestureTouch[i].id == touchId)
touch = &SDL_gestureTouch[i];
- if (touch == NULL) return -1;
+ if (touch == NULL) return SDL_SetError("given touch id not found");
}
while (1) {