From 3584910baa907610582b4b3330bb1c06c6badba5 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Sat, 22 Nov 2025 09:23:03 +0100 Subject: [PATCH] Fixed reading the last line of config --- src/util.cpp | 2 +- tests/src/test_params.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 41ac1f1..f2d358b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1049,7 +1049,7 @@ std::vector> parse_config(const std::string& file_name) std::string s; - while (std::getline(f, s).good()) { + while (f.good() && std::getline(f, s)) { if (s.empty()) { continue; } diff --git a/tests/src/test_params.conf b/tests/src/test_params.conf index 6aea144..1c2d25d 100644 --- a/tests/src/test_params.conf +++ b/tests/src/test_params.conf @@ -14,4 +14,4 @@ param6 = value1 value2 value3 param8#comment param9 -abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789=0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz=:// +abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789=0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz=:// \ No newline at end of file