diff --git a/string_utils.cpp b/string_utils.cpp index 53713c5..ce3bd10 100644 --- a/string_utils.cpp +++ b/string_utils.cpp @@ -82,8 +82,7 @@ string sc::file_get_contents(const string& path) file.seekg(0, ios::end); ios::pos_type file_len {file.tellg()}; file.seekg(0); - vector buf; - buf.resize(file_len); + vector buf(file_len); file.read(buf.data(), file_len); return {buf.data(), static_cast(file_len)}; }