summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-03-22 09:28:15 +0000
committerDave Chapman <dave@dchapman.com>2008-03-22 09:28:15 +0000
commitbca8edd856cee3a3b469ef9fe2770a191b590fde (patch)
tree69bd8fbb9b49d5cade86c1a899ae2b84fb07aa2d /apps
parent45b2d8802d1e8fcc47fd1148adb7b1173ad5b311 (diff)
downloadrockbox-bca8edd856cee3a3b469ef9fe2770a191b590fde.zip
rockbox-bca8edd856cee3a3b469ef9fe2770a191b590fde.tar.gz
rockbox-bca8edd856cee3a3b469ef9fe2770a191b590fde.tar.bz2
rockbox-bca8edd856cee3a3b469ef9fe2770a191b590fde.tar.xz
Small simplification - take advantage of the fact that x/y/width/height are non-negative integers when validating the viewport bounds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16736 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/wps_parser.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index be3d2fb..a791440 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -564,9 +564,7 @@ static int parse_viewport(const char *wps_bufptr,
#ifdef HAVE_REMOTE_LCD
if (wps_data->remote_wps)
{
- if ((vp->x >= LCD_REMOTE_WIDTH) ||
- ((vp->x + vp->width) >= LCD_REMOTE_WIDTH) ||
- (vp->y >= LCD_REMOTE_HEIGHT) ||
+ if (((vp->x + vp->width) >= LCD_REMOTE_WIDTH) ||
((vp->y + vp->height) >= LCD_REMOTE_HEIGHT))
{
return WPS_ERROR_INVALID_PARAM;
@@ -575,8 +573,7 @@ static int parse_viewport(const char *wps_bufptr,
else
#else
{
- if ((vp->x >= LCD_WIDTH) ||
- (vp->y >= LCD_HEIGHT) ||
+ if (((vp->x + vp->width) >= LCD_WIDTH) ||
((vp->y + vp->height) >= LCD_HEIGHT))
{
return WPS_ERROR_INVALID_PARAM;