From 235d072db5dc3d9b82d745eb817bfeddcba38595 Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Fri, 5 Sep 2014 00:53:42 +0400 Subject: [PATCH] Cast malloc to wchar_t. This is required in C++. https://github.com/ariya/phantomjs/issues/12543 https://github.com/ariya/phantomjs/issues/12236 --- src/crashdump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crashdump.cpp b/src/crashdump.cpp index 72d06edd..946b4e23 100644 --- a/src/crashdump.cpp +++ b/src/crashdump.cpp @@ -85,7 +85,7 @@ q_wgetenv(const wchar_t *varName) // We have to employ a scratch buffer. Limiting the length to // INT_MAX / sizeof(wchar_t), above, ensures that the multiplication // here cannot overflow. - wchar_t *buffer = malloc(requiredSize * sizeof(wchar_t)); + wchar_t *buffer = (wchar_t *)malloc(requiredSize * sizeof(wchar_t)); if (!buffer) return QString();