diff options
author | Georg Gadinger <nilsding@nilsding.org> | 2021-01-23 16:39:23 +0100 |
---|---|---|
committer | Georg Gadinger <nilsding@nilsding.org> | 2021-01-27 18:21:31 +0100 |
commit | 278e7457ea88ea7dd8765d586d4f45315c3f546d (patch) | |
tree | f91ec73b7b61f6fb17786fbfa8a83105b5fc0a37 /apps/gui/skin_engine/skin_tokens.c | |
parent | befae2909f56ff81278e73e963a707537057459f (diff) | |
download | rockbox-278e7457ea88ea7dd8765d586d4f45315c3f546d.tar.gz rockbox-278e7457ea88ea7dd8765d586d4f45315c3f546d.zip |
skin_engine: Fix %if() when comparing against a negative number.
If the tag being checked returns a negative number (e.g. %LI does that
when the current list item does not have an icon) the tag's value would
always end up being 1.
Change-Id: I69ab175b6c46dd7567386e649732dbb8327972fc
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 9df8b7d0c4..b36b49c626 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -598,7 +598,7 @@ static const char* NOINLINE get_lif_token_value(struct gui_wps *gwps, | |||
598 | break; | 598 | break; |
599 | } | 599 | } |
600 | case INTEGER: | 600 | case INTEGER: |
601 | if (!number_set && out_text && *out_text >= '0' && *out_text <= '9') | 601 | if (!number_set && out_text && ((*out_text >= '0' && *out_text <= '9') || (*out_text == '-' && out_text[1] >= '0' && out_text[1] <= '9'))) |
602 | a = atoi(out_text); | 602 | a = atoi(out_text); |
603 | /* fall through */ | 603 | /* fall through */ |
604 | case PERCENT: | 604 | case PERCENT: |