[ox/mc] Fix break from using strnlen_s inappropriately
All checks were successful
Build / build (push) Successful in 1m33s
All checks were successful
Build / build (push) Successful in 1m33s
This commit is contained in:
parent
0dc72d1826
commit
6c970f926c
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>
|
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;
|
bool fieldSet = false;
|
||||||
if (!m_unionIdx.has_value() || *m_unionIdx == m_field) {
|
if (!m_unionIdx.has_value() || *m_unionIdx == m_field) {
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
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
|
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||||
// write the length
|
// write the length
|
||||||
const auto strLenBuff = mc::encodeInteger(strLen);
|
const auto strLenBuff = mc::encodeInteger(strLen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user