commit 8e69ab8a31809f1e7e6fe8de67faa36b63219270 (tree)
parent 7e4c386f6ab5546898b94d80f54e88d45dc6c7b9
Author: GasInfinity <me@gasinfinity.dev>
Date: Mon, 12 Jan 2026 17:55:03 +0100
fix(libzigc): negative bases are also invalid
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/c/stdlib.zig b/lib/c/stdlib.zig
@@ -128,7 +128,7 @@ fn strtoumax(noalias str: [*:0]const c_char, noalias str_end: ?*[*:0]const c_cha
fn stringToInteger(comptime T: type, noalias buf: [*:0]const u8, noalias maybe_end: ?*[*:0]const u8, base: c_int) T {
comptime assert(std.math.isPowerOfTwo(@bitSizeOf(T)));
- if (base == 1 or base > 36) {
+ if (base < 0 or base == 1 or base > 36) {
if (maybe_end) |end| {
end.* = buf;
}