From: Joel Rosdahl Date: Thu, 16 Jul 2020 15:08:28 +0000 (+0200) Subject: Use Util::read_file instead of legacy read_text_file X-Git-Tag: v4.0~319 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2603922106a84bbf89732825f9107c66a840e769;p=thirdparty%2Fccache.git Use Util::read_file instead of legacy read_text_file --- diff --git a/src/stats.cpp b/src/stats.cpp index 6676f5520..ec3979572 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -297,11 +297,12 @@ stats_update_size(Counters& counters, int64_t size, int files) void stats_read(const std::string& path, Counters& counters) { - char* data = read_text_file(path.c_str(), 1024); - if (data) { - parse_stats(counters, data); + try { + std::string data = Util::read_file(path); + parse_stats(counters, data.c_str()); + } catch (Error&) { + // Ignore. } - free(data); } // Write counter updates in updates to sfile.