mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
9a5d69c842
The C standard states that, in the context of an x conversion specifier given to scanf: > Matches an optionally signed hexadecimal integer, whose format is > the same as expected for the subject sequence of the strtoul > function with the value 16 for the base argument. - C standard, 7.23.6.2.11. The fscanf function Cosmopolitan fails to do this, as 0 should be parsed as a 0 by such an invocation of strtoul. Instead, cosmopolitan errors out as though such input is invalid, which is wrong. This means that a program such as this: #include <stdio.h> #undef NDEBUG #include <assert.h> int main() { int v = 0; assert(sscanf("0", "%x", &v) == 1); } will not run correctly on cosmpolitan, instead failing the assertion. This patch fixes this, along with the associated GitHub issue, https://github.com/jart/cosmopolitan/issues/778 |
||
---|---|---|
.. | ||
dsp | ||
libc | ||
net | ||
tool | ||
test.mk |