From 1ac3ba964ddbc64aee03cd1b289e33b265c20aef Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 6 Jul 2022 15:11:55 +0300 Subject: [PATCH] Fix check --- src/config.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/config.cc b/src/config.cc index 04ccf4f..bbd2370 100644 --- a/src/config.cc +++ b/src/config.cc @@ -155,9 +155,7 @@ bool configSetString(Config* config, const char* sectionKey, const char* key, co int sectionIndex = dictionaryGetIndexByKey(config, sectionKey); if (sectionIndex == -1) { - // FIXME: Looks like a bug, this function never returns -1, which will - // eventually lead to crash. - if (configEnsureSectionExists(config, sectionKey) == -1) { + if (!configEnsureSectionExists(config, sectionKey)) { return false; } sectionIndex = dictionaryGetIndexByKey(config, sectionKey);