diff --git a/modules/log/file_async_channel.cpp b/modules/log/file_async_channel.cpp index 1324ae335976ff1740a2ea512f95ae3fe3785464..9f82b59a82a6591eebf381994aef5f5d38eee32f 100644 --- a/modules/log/file_async_channel.cpp +++ b/modules/log/file_async_channel.cpp @@ -65,8 +65,8 @@ void FileAsyncChannel::onLogBackEnd(const void *data_ptr, size_t data_size) return; const char *start_ptr = static_cast(data_ptr); - if (buffer_.size() < (data_size + 1)) - buffer_.resize(data_size + 1); + if (buffer_.size() < data_size) + buffer_.resize(data_size); std::transform(start_ptr, start_ptr + data_size, buffer_.begin(), [](char ch) { return ch == 0 ? '\n' : ch; } diff --git a/modules/util/json.h b/modules/util/json.h index dfb668984db604d2eeeab2d15deecee357135f53..08167846917ac9609ccccceed4735a86f6238ac6 100644 --- a/modules/util/json.h +++ b/modules/util/json.h @@ -1,6 +1,7 @@ #ifndef TBOX_UTIL_JSON_H_20220908 #define TBOX_UTIL_JSON_H_20220908 +#include #include namespace tbox { diff --git a/modules/util/json_deep_loader.h b/modules/util/json_deep_loader.h index 273788a572fb71ff6690c4001054c81067ba3506..f74b415425f00ed26175840a113e6605b0e25b72 100644 --- a/modules/util/json_deep_loader.h +++ b/modules/util/json_deep_loader.h @@ -61,6 +61,7 @@ * */ +#include #include namespace tbox {