upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/mods.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/mods.h')
-rw-r--r--runtime/src/mods.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/src/mods.h b/runtime/src/mods.h
index 10155bf19..bd635e9a0 100644
--- a/runtime/src/mods.h
+++ b/runtime/src/mods.h
@@ -78,8 +78,8 @@ struct LoadResult {
78// "0x..." -> that value; anything else -> joaat(name). Returns false for an empty name or a malformed hex value. 78// "0x..." -> that value; anything else -> joaat(name). Returns false for an empty name or a malformed hex value.
79inline bool parse_model_id(const std::string& text, uint32_t& out) { 79inline bool parse_model_id(const std::string& text, uint32_t& out) {
80 if (text.empty()) return false; 80 if (text.empty()) return false;
81 if (text.size() > 2 && text[0] == '0' && (text[1] == 'x' || text[1] == 'X')) { 81 if (text.size() >= 2 && text[0] == '0' && (text[1] == 'x' || text[1] == 'X')) {
82 if (text.size() > 10) return false; 82 if (text.size() == 2 || text.size() > 10) return false;
83 uint32_t v = 0; 83 uint32_t v = 0;
84 for (std::size_t i = 2; i < text.size(); ++i) { 84 for (std::size_t i = 2; i < text.size(); ++i) {
85 const char c = text[i]; 85 const char c = text[i];