[ox/oc] Resize vectors before writing to them
This commit is contained in:
parent
313b35f605
commit
8480eeba0c
3
deps/ox/src/ox/oc/read.hpp
vendored
3
deps/ox/src/ox/oc/read.hpp
vendored
@ -114,6 +114,9 @@ template<typename T>
|
||||
Error OrganicClawReader::field(const char *key, T *val) noexcept {
|
||||
auto err = OxError(0);
|
||||
if constexpr(isVector_v<T>) {
|
||||
const auto &srcVal = value(key);
|
||||
const auto srcSize = srcVal.size();
|
||||
val->resize(srcSize);
|
||||
return field(key, val->data(), val->size());
|
||||
} else if (targetValid()) {
|
||||
const auto &jv = value(key);
|
||||
|
Loading…
Reference in New Issue
Block a user