[ox/oc] Resize vectors before writing to them

This commit is contained in:
Gary Talent 2021-07-31 03:37:23 -05:00
parent 313b35f605
commit 8480eeba0c

View File

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