summaryrefslogtreecommitdiffstats
path: root/tools/checkwps/checkwps.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-07-31 10:05:58 +0200
committerThomas Martitz <kugel@rockbox.org>2012-07-31 10:05:58 +0200
commitb358bcfc25272cb03dc95809c0c82688943f0f84 (patch)
tree5656bb5f9bbd8199a15a8deff693c67be74d65de /tools/checkwps/checkwps.c
parent63d27626e417f0e80b649ca366e79ba92473a6d4 (diff)
downloadrockbox-b358bcfc25272cb03dc95809c0c82688943f0f84.tar.gz
rockbox-b358bcfc25272cb03dc95809c0c82688943f0f84.tar.bz2
rockbox-b358bcfc25272cb03dc95809c0c82688943f0f84.zip
checkwps: Simplify expression.
Change-Id: I4d5cf82aa753074f81f25ae3d89a97ee607376e5
Diffstat (limited to 'tools/checkwps/checkwps.c')
-rw-r--r--tools/checkwps/checkwps.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index bfcb99f17e..273db78646 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -294,9 +294,8 @@ int main(int argc, char **argv)
while (argv[filearg]) {
printf("Checking %s...\n", argv[filearg]);
#ifdef HAVE_REMOTE_LCD
- if((strcmp(&argv[filearg][strlen(argv[filearg])-4], "rwps") == 0) ||
- (strcmp(&argv[filearg][strlen(argv[filearg])-4], "rsbs") == 0) ||
- (strcmp(&argv[filearg][strlen(argv[filearg])-4], "rfms") == 0))
+ char *ext = strrchr(argv[filearg], '.');
+ if (strcmp(ext, "rwps") == 0 || strcmp(ext, "rsbs") == 0 || strcmp(ext, "rfms") == 0)
screen = SCREEN_REMOTE;
else
screen = SCREEN_MAIN;