diff --git a/userspace/libraries/LibC/stdlib.cpp b/userspace/libraries/LibC/stdlib.cpp index fb1c12fd..ad7135ce 100644 --- a/userspace/libraries/LibC/stdlib.cpp +++ b/userspace/libraries/LibC/stdlib.cpp @@ -211,6 +211,8 @@ static T strtoT(const char* str, char** endp, int& error) // no conversion can be performed -- not ([digit] || .[digit]) if (!(isdigit(*str) || (str[0] == '.' && isdigit(str[1])))) { + if (endp) + *endp = const_cast(str); error = EINVAL; return 0; }