Fix segfault on complex pointer formatting (#285)
diff --git a/Source/GmmLib/Utility/GmmLog/spdlog/details/format.h b/Source/GmmLib/Utility/GmmLog/spdlog/details/format.h
index 34551f7..e849181 100644
--- a/Source/GmmLib/Utility/GmmLog/spdlog/details/format.h
+++ b/Source/GmmLib/Utility/GmmLog/spdlog/details/format.h
@@ -3084,14 +3084,15 @@
CharPtr p = grow_buffer(fill_size);
std::uninitialized_fill(p, p + fill_size, fill);
}
- CharPtr result = prepare_int_buffer(
- num_digits, subspec, prefix, prefix_size);
+ std::ptrdiff_t offset = get(prepare_int_buffer(
+ num_digits, subspec, prefix, prefix_size)) -
+ &buffer_[0];
if (align == ALIGN_LEFT)
{
CharPtr p = grow_buffer(fill_size);
std::uninitialized_fill(p, p + fill_size, fill);
}
- return result;
+ return internal::make_ptr(&buffer_[0], buffer_.size()) + offset;
}
unsigned size = prefix_size + num_digits;
if (width <= size)