From 20e3839871c0864998d5fb07e265b9316aa039c4 Mon Sep 17 00:00:00 2001 From: oshaboy Date: Mon, 20 Jan 2025 02:05:08 +0200 Subject: [PATCH] Forgot to add this check to the config file. --- configuration.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configuration.c b/configuration.c index 6908dbc3f5ce..4bbb7edbfb59 100644 --- a/configuration.c +++ b/configuration.c @@ -6705,10 +6705,12 @@ unsigned input_config_parse_sensor( if (config_get_array(conf, s, tmp, sizeof(tmp))) { if (strcmp(tmp, "nul") != 0){ - if (strcmp(tmp+1,"inv") == 0) - return (((*tmp)-0x30)*2)+1; - else if (tmp[1] == '\0') - return ((*tmp)-0x30)*2; + if (*tmp>='0' && *tmp<='5'){ + if (strcmp(tmp+1,"inv") == 0) + return (((*tmp)-'0')*2)+1; + else if (tmp[1] == '\0') + return ((*tmp)-'0')*2; + } } } return id*2;