summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/wps_parser.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 8ae83924c2..248269ddcb 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -1168,7 +1168,7 @@ static int parse_touchregion(const char *wps_bufptr,
1168 struct wps_token *token, struct wps_data *wps_data) 1168 struct wps_token *token, struct wps_data *wps_data)
1169{ 1169{
1170 (void)token; 1170 (void)token;
1171 unsigned i; 1171 unsigned i, imax;
1172 struct touchregion *region; 1172 struct touchregion *region;
1173 const char *ptr = wps_bufptr; 1173 const char *ptr = wps_bufptr;
1174 const char *action; 1174 const char *action;
@@ -1218,11 +1218,15 @@ static int parse_touchregion(const char *wps_bufptr,
1218 } 1218 }
1219 else 1219 else
1220 region->repeat = false; 1220 region->repeat = false;
1221 1221
1222 imax = ARRAYLEN(touchactions);
1222 while ((region->action == ACTION_NONE) && 1223 while ((region->action == ACTION_NONE) &&
1223 (i < sizeof(touchactions)/sizeof(*touchactions))) 1224 (i < imax))
1224 { 1225 {
1225 if (!strncmp(touchactions[i].s, action, strlen(touchactions[i].s))) 1226 /* try to match with one of our touchregion screens */
1227 int len = strlen(touchactions[i].s);
1228 if (!strncmp(touchactions[i].s, action, len)
1229 && *(action+len) == '|')
1226 region->action = touchactions[i].action; 1230 region->action = touchactions[i].action;
1227 i++; 1231 i++;
1228 } 1232 }