From b6ee5fcbe94910bf897ef321d10afc0a0fa4e8d8 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 28 Dec 2022 09:14:30 +0300 Subject: [PATCH] Fix configGetIntList --- src/config.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.cc b/src/config.cc index 2547896..9143e55 100644 --- a/src/config.cc +++ b/src/config.cc @@ -248,12 +248,14 @@ bool configGetIntList(Config* config, const char* sectionKey, const char* key, i string = pch + 1; } - if (count <= 1) { + // SFALL: Fix getting last item in a list if the list has less than the + // requested number of values (for `chem_primary_desire`). + if (count > 0) { *arr = atoi(string); - return true; + count--; } - return false; + return count == 0; } // 0x42C160