mirror of https://github.com/vitalif/phantomjs
Cast malloc to wchar_t. This is required in C++.
https://github.com/ariya/phantomjs/issues/12543 https://github.com/ariya/phantomjs/issues/122362.0
parent
ab2e4788c6
commit
235d072db5
|
@ -85,7 +85,7 @@ q_wgetenv(const wchar_t *varName)
|
||||||
// We have to employ a scratch buffer. Limiting the length to
|
// We have to employ a scratch buffer. Limiting the length to
|
||||||
// INT_MAX / sizeof(wchar_t), above, ensures that the multiplication
|
// INT_MAX / sizeof(wchar_t), above, ensures that the multiplication
|
||||||
// here cannot overflow.
|
// here cannot overflow.
|
||||||
wchar_t *buffer = malloc(requiredSize * sizeof(wchar_t));
|
wchar_t *buffer = (wchar_t *)malloc(requiredSize * sizeof(wchar_t));
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue