Reject negative unsigned string values

This commit is contained in:
udo
2026-07-18 16:22:14 +00:00
parent 22efea8ecd
commit 39d4b41e2b
3 changed files with 15 additions and 4 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ to_bool
int_val
:content
Parses a trimmed string as a base-10 unsigned integer.
Parses a trimmed string as a base-10 unsigned integer. An optional leading `+`
is accepted. Negative and overflowing values return the fallback.
Unlike `int_val()`, the whole trimmed string must be consumed by the parser. Empty strings and partially parsed values such as `"42px"` return the fallback.