From 4b8de66ec408579a96827aeab8d15b44853e83d2 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 21 Aug 2022 13:55:33 -0500 Subject: [PATCH] fix: use stream existence to check whether to use defaults --- main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 6f07b9f..c8e662b 100644 --- a/main.cpp +++ b/main.cpp @@ -61,11 +61,10 @@ uint64_t find_patch_address(const std::vector &search_buffer) { int main() { ifstream ifs("modlimitfix.conf"); - uint32_t mod_limit; bool using_conf = false; - ifs >> mod_limit; - if (mod_limit) { - patched_limit = mod_limit; + if (ifs) { + //patched_limit = mod_limit; + ifs >> patched_limit; using_conf = true; } if (using_conf) {