On Mon, 2025-02-24 at 16:38 -0800, Andrii Nakryiko wrote: [...] > > + } else if (*val == '-' || isdigit(*val)) { > > instead of doing this detection based on characters, why not try to > parse a number (and I'd use sscanf("%lli") which will handle 1234 and > 0x1234 transparently)? And you can use %n to check that all characters > were parsed (i.e., you have exact match) > > it's probably fine for starters, but it kind of sucks that 0x1234 > isn't supported (Nit: {strtoull,strtoll}(val, NULL, 0) supports decimal and hexadecimal notations). [...]