mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 01:10:26 +08:00
Added nullptr check to append_string_view
This commit is contained in:
parent
6355e9895d
commit
a5a39c52b0
@ -24,8 +24,11 @@ template<size_t Buffer_Size>
|
|||||||
inline void append_string_view(fmt::string_view view, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
|
inline void append_string_view(fmt::string_view view, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
|
||||||
{
|
{
|
||||||
auto *buf_ptr = view.data();
|
auto *buf_ptr = view.data();
|
||||||
|
if(buf_ptr != nullptr)
|
||||||
|
{
|
||||||
dest.append(buf_ptr, buf_ptr + view.size());
|
dest.append(buf_ptr, buf_ptr + view.size());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T, size_t Buffer_Size>
|
template<typename T, size_t Buffer_Size>
|
||||||
inline void append_int(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
|
inline void append_int(T n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
|
||||||
|
Loading…
Reference in New Issue
Block a user