[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

@@ -28,7 +28,9 @@ ClArgs::ClArgs(int argc, const char **args) {
m_bools[arg] = false;
}
m_strings[arg] = val;
m_ints[arg] = ox_atoi(val.c_str());
if (auto r = ox_atoi(val.c_str()); r.error == 0) {
m_ints[arg] = r.value;
}
i++;
}
}