[ox/std] Cleanup an unsafe buffer

This commit is contained in:
Gary Talent 2024-11-26 20:38:00 -06:00
parent 114f5c6685
commit e13eebaf0b

View File

@ -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);
}