Codechange: Replace strtol, strtoll, stroul and strtoull with ParseInteger.

This commit is contained in:
frosch
2025-04-29 17:00:55 +02:00
committed by frosch
parent cdafc50c94
commit 98481ecc01
8 changed files with 52 additions and 16 deletions

View File

@@ -636,7 +636,13 @@ int openttd_main(std::span<char * const> arguments)
_skip_all_newgrf_scanning += 1;
break;
}
case 'G': scanner->generation_seed = std::strtoul(mgo.opt, nullptr, 10); break;
case 'G':
if (auto value = ParseInteger(mgo.opt); value.has_value()) {
scanner->generation_seed = *value;
} else {
fmt::print(stderr, "Invalid generation seed: {}\n", mgo.opt);
}
break;
case 'c': _config_file = mgo.opt; break;
case 'x': scanner->save_config = false; break;
case 'X': only_local_path = true; break;