From 0f239dc39d94ce9236ce99f271e1d3f161c67e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 6 Apr 2021 20:53:18 +0200 Subject: [PATCH] Fix warning in temp profile parser --- stm-firmware/config-parser/temp-profile-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stm-firmware/config-parser/temp-profile-parser.c b/stm-firmware/config-parser/temp-profile-parser.c index c8b0670..7e5500f 100644 --- a/stm-firmware/config-parser/temp-profile-parser.c +++ b/stm-firmware/config-parser/temp-profile-parser.c @@ -106,7 +106,7 @@ static int parse_line(char *line, struct pl_command *cmd) uint8_t token_idx = 0; char *token; const char * const delim = " \t"; - const struct pl_command_list_map *map; + const struct pl_command_list_map *map = NULL; char *endptr; struct pl_command c; @@ -146,7 +146,7 @@ static int parse_line(char *line, struct pl_command *cmd) token_idx++; } - if (token_idx - 1 < map->expected_param_count) { + if (!map || (token_idx - 1 < map->expected_param_count)) { return -3; }