Squashed 'deps/nostalgia/' changes from 9676ea59..26fe266b

26fe266b [ox/mc] Fix break from using strnlen_s inappropriately
091eda7b Merge commit 'ce53be92716b0f5201882d6959c398b61c6cc93c'
ac29f7a0 Merge commit 'ec6cf92c4763be5933ee6debbf97bce25b9fcfc9'
eef51a6d [olympic] Improve error handling in file-to-cpp

git-subtree-dir: deps/nostalgia
git-subtree-split: 26fe266b09971d3e638654515f41226afc7f4625
This commit is contained in:
2025-05-07 01:20:37 -05:00
parent ce53be9271
commit 8e033b2460
2 changed files with 23 additions and 13 deletions

View File

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