mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Update example.cpp to fix the vector issue in bin_example (#2963)
with std::vector<char> buf(80), 80 elements are put in the vector, which is not the expected behavior.
This commit is contained in:
parent
ac55e60488
commit
ba508057b1
@ -180,7 +180,7 @@ void async_example() {
|
|||||||
#if !defined SPDLOG_USE_STD_FORMAT || defined(_MSC_VER)
|
#if !defined SPDLOG_USE_STD_FORMAT || defined(_MSC_VER)
|
||||||
#include "spdlog/fmt/bin_to_hex.h"
|
#include "spdlog/fmt/bin_to_hex.h"
|
||||||
void binary_example() {
|
void binary_example() {
|
||||||
std::vector<char> buf(80);
|
std::vector<char> buf;
|
||||||
for (int i = 0; i < 80; i++) {
|
for (int i = 0; i < 80; i++) {
|
||||||
buf.push_back(static_cast<char>(i & 0xff));
|
buf.push_back(static_cast<char>(i & 0xff));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user