mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Set errno when out of range in strtoimax (#111)
This commit is contained in:
parent
f5da4efcaf
commit
8a6ac6dd63
5 changed files with 29 additions and 5 deletions
|
@ -443,7 +443,7 @@ bool ConsumeLiteral(const char *literal) {
|
|||
char *e;
|
||||
struct Value x;
|
||||
x.t = kInt;
|
||||
x.i = strtoimax(literal, &e, 0);
|
||||
x.i = *literal == '-' ? strtoimax(literal, &e, 0) : strtoumax(literal, &e, 0);
|
||||
if (!e || *e) {
|
||||
x.t = kFloat;
|
||||
x.f = strtod(literal, &e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue