From 20c19dde350b40678163c0d6baeddb23e9087780 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Jun 2005 21:22:18 +0000 Subject: No need to keep code around that we _know_ will cause crashes... Bail out nicer when certain syntax errors are used with the bitmap option. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6867 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps-display.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/wps-display.c') diff --git a/apps/wps-display.c b/apps/wps-display.c index 8afb803856..e7c5472ea9 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -854,9 +854,14 @@ static void format_display(char* buf, } #endif /* skip the tag */ -/* WARNING! This will crash if there's a syntax error in the wps file */ for (n = 0; n < 4; n++) { - fmt = strchr(fmt+1, '|'); /* get the next '|' */ + char *ptr; + ptr = strchr(fmt+1, '|'); /* get the next '|' */ + if(ptr) + fmt=ptr; + else + /* syntax error, bail out of loop */ + break; } fmt++; break; -- cgit v1.2.3