[ox/mc] Fix break from using strnlen_s inappropriately
All checks were successful
Build / build (push) Successful in 1m16s
All checks were successful
Build / build (push) Successful in 1m16s
This commit is contained in:
parent
091eda7b44
commit
26fe266b09
7
deps/ox/src/ox/mc/write.hpp
vendored
7
deps/ox/src/ox/mc/write.hpp
vendored
@ -211,11 +211,14 @@ constexpr Error MetalClawWriter<Writer>::field(const char *name, const IString<L
|
||||
}
|
||||
|
||||
template<Writer_c Writer>
|
||||
constexpr Error MetalClawWriter<Writer>::fieldCString(const char*, const char *const*val, std::size_t buffLen) noexcept {
|
||||
constexpr Error MetalClawWriter<Writer>::fieldCString(const char*, const char *const*val, std::size_t) noexcept {
|
||||
bool fieldSet = false;
|
||||
if (!m_unionIdx.has_value() || *m_unionIdx == m_field) {
|
||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||
const auto strLen = *val ? ox::strnlen_s(*val, buffLen) : 0;
|
||||
// this strlen is tolerated because sometimes 0 gets passed to
|
||||
// the size param, which is a lie
|
||||
// this code should be cleaned up at some point...
|
||||
const auto strLen = *val ? ox::strlen(*val) : 0;
|
||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||
// write the length
|
||||
const auto strLenBuff = mc::encodeInteger(strLen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user