summaryrefslogtreecommitdiff
path: root/apps/gui/wps_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps_parser.c')
-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,
struct wps_token *token, struct wps_data *wps_data)
{
(void)token;
- unsigned i;
+ unsigned i, imax;
struct touchregion *region;
const char *ptr = wps_bufptr;
const char *action;
@@ -1218,11 +1218,15 @@ static int parse_touchregion(const char *wps_bufptr,
}
else
region->repeat = false;
-
+
+ imax = ARRAYLEN(touchactions);
while ((region->action == ACTION_NONE) &&
- (i < sizeof(touchactions)/sizeof(*touchactions)))
+ (i < imax))
{
- if (!strncmp(touchactions[i].s, action, strlen(touchactions[i].s)))
+ /* try to match with one of our touchregion screens */
+ int len = strlen(touchactions[i].s);
+ if (!strncmp(touchactions[i].s, action, len)
+ && *(action+len) == '|')
region->action = touchactions[i].action;
i++;
}