diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-06-25 21:22:18 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-06-25 21:22:18 +0000 |
commit | 20c19dde350b40678163c0d6baeddb23e9087780 (patch) | |
tree | 3236810ce8065056ad1f842dd510a1ec792b7462 /apps/wps-display.c | |
parent | af50cae14d9b5b1883789034e4af94e4c25fed94 (diff) |
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
Diffstat (limited to 'apps/wps-display.c')
-rw-r--r-- | apps/wps-display.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |