From 278e7457ea88ea7dd8765d586d4f45315c3f546d Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Sat, 23 Jan 2021 16:39:23 +0100 Subject: [PATCH] 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 --- apps/gui/skin_engine/skin_tokens.c | 2 +- docs/CREDITS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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, break; } case INTEGER: - if (!number_set && out_text && *out_text >= '0' && *out_text <= '9') + if (!number_set && out_text && ((*out_text >= '0' && *out_text <= '9') || (*out_text == '-' && out_text[1] >= '0' && out_text[1] <= '9'))) a = atoi(out_text); /* fall through */ case PERCENT: diff --git a/docs/CREDITS b/docs/CREDITS index 24de5498a8..b1a9675f8f 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -699,6 +699,7 @@ Michael Rey Yuxuan Shui James Buren Issa Beganović +Georg Gadinger The libmad team The wavpack team