msvcrt: Set *end to NULL when strtod is called with NULL pointer string.
This commit is contained in:
parent
ffcb4e0724
commit
abbb361733
|
@ -317,8 +317,11 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
|
|||
|
||||
if(err)
|
||||
*err = 0;
|
||||
else
|
||||
if(!MSVCRT_CHECK_PMT(str != NULL)) return 0;
|
||||
else if(!MSVCRT_CHECK_PMT(str != NULL)) {
|
||||
if (end)
|
||||
*end = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!locale)
|
||||
locinfo = get_locinfo();
|
||||
|
|
|
@ -1694,7 +1694,7 @@ static void test__strtod(void)
|
|||
d = strtod(NULL, &end);
|
||||
ok(almost_equal(d, 0.0), "d = %lf\n", d);
|
||||
ok(errno == EINVAL, "errno = %x\n", errno);
|
||||
todo_wine ok(!end, "incorrect end ptr %p\n", end);
|
||||
ok(!end, "incorrect end ptr %p\n", end);
|
||||
|
||||
errno = EBADF;
|
||||
d = p__strtod_l(NULL, NULL, NULL);
|
||||
|
|
Loading…
Reference in New Issue