[ox/std] Make ox_atoi return an ox::Result

This commit is contained in:
2021-03-03 00:30:16 -06:00
parent 28e68adc75
commit c5773202b5
3 changed files with 14 additions and 7 deletions

View File

@@ -49,7 +49,9 @@ Result<ClawHeader> readHeader(const char *buff, std::size_t buffLen) noexcept {
return OxError(1);
}
hdr.typeName = typeName;
hdr.typeVersion = ox_atoi(versionStr.c_str());
if (auto r = ox_atoi(versionStr.c_str()); r.error == 0) {
hdr.typeVersion = r.value;
}
hdr.data = buff;
hdr.dataSize = buffLen;
return hdr;