diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f253bf..288d80c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastobotmon - VERSION 0.3.8 + VERSION 0.3.9 LANGUAGES CXX) include(GNUInstallDirs) diff --git a/src/config.cpp b/src/config.cpp index 4987cff..056aaf9 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -40,8 +40,9 @@ const bool read_config() { json << file.rdbuf(); file.close(); + json >> config; - if (json >> config) + if (!config.isObject()) { cerr << "ERROR: couldn't parse config file. Are you sure the JSON is well-formed?\n"; return false; diff --git a/src/mastobotmon.cpp b/src/mastobotmon.cpp index 72cdfc0..7aa3ce2 100644 --- a/src/mastobotmon.cpp +++ b/src/mastobotmon.cpp @@ -97,8 +97,8 @@ const bool write_statistics(const string &straccount, Easy::Account &account_ent ss << std::put_time(&now_tm, "%Y-%m-%dT%T"); output = ss.str() + ';'; - output += account_entity.statuses_count() + ';'; - output += account_entity.followers_count() + '\n'; + output += std::to_string(account_entity.statuses_count()) + ';'; + output += std::to_string(account_entity.followers_count()) + '\n'; outfile.write(output.c_str(), output.length()); outfile.close();