diff options
Diffstat (limited to 'Libraries/LibC')
-rw-r--r-- | Libraries/LibC/stdlib.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp index 925e8882e5..a823ffaf91 100644 --- a/Libraries/LibC/stdlib.cpp +++ b/Libraries/LibC/stdlib.cpp @@ -335,7 +335,9 @@ double strtod(const char* str, char** endptr) } if (str[i] == 'e' || str[i] == 'E') { - if (str[i + 1] == '-' || str[i + 1] == '+') + if (str[i + 1] == '-') + exp_val = -atoi(str + i + 2); + else if (str[i + 1] == '+') exp_val = atoi(str + i + 2); else exp_val = atoi(str + i + 1); |