From cb55b5906a5748462eb720d2bd5278ecfbef8503 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 28 Jan 2021 09:11:46 +0100 Subject: [PATCH] - Fix empty clause warning in config_file nsid parse. --- doc/Changelog | 1 + util/config_file.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index f6d32249b..8e6794136 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 28 January 2022: Wouter - Annotate that we ignore the return value of if_indextoname. - Fix to use correct type for label count in rpz routine. + - Fix empty clause warning in config_file nsid parse. 26 January 2022: George - Merge PR #408 from fobser: Prevent a few more yacc clashes. diff --git a/util/config_file.c b/util/config_file.c index 28816f747..4d87dee9b 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -2064,8 +2064,9 @@ uint8_t* cfg_parse_nsid(const char* str, uint16_t* nsid_len) if ((nsid = (uint8_t *)strdup(str + 6))) *nsid_len = strlen(str + 6); - } else if (strlen(str) % 2) + } else if (strlen(str) % 2) { ; /* hex string has even number of characters */ + } else if (*str && (nsid = calloc(1, strlen(str) / 2))) { const char *ch; -- 2.47.2