[ox/std] Cleanup an unsafe buffer
This commit is contained in:
parent
114f5c6685
commit
e13eebaf0b
8
deps/ox/src/ox/std/fmt.hpp
vendored
8
deps/ox/src/ox/std/fmt.hpp
vendored
@ -81,16 +81,16 @@ class FmtArg {
|
||||
|
||||
private:
|
||||
static constexpr auto DataSz = 23;
|
||||
char dataStr[DataSz] = {};
|
||||
ox::Array<char, DataSz> dataStr{};
|
||||
|
||||
template<typename T>
|
||||
constexpr StringView sv(const T &v, char *dataStr) noexcept {
|
||||
constexpr StringView sv(const T &v, ox::Span<char> dataStr) noexcept {
|
||||
if constexpr(is_bool_v<T>) {
|
||||
return v ? "true" : "false";
|
||||
} else if constexpr(is_integer_v<T>) {
|
||||
ox::CharBuffWriter w(dataStr, DataSz);
|
||||
ox::CharBuffWriter w(dataStr.data(), DataSz);
|
||||
std::ignore = ox::writeItoa(v, w);
|
||||
return dataStr;
|
||||
return dataStr.data();
|
||||
} else {
|
||||
return toStringView(v);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user