diff options
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; |