diff options
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index efeb813a2d..eaf62a3e0a 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1534,7 +1534,9 @@ void OS_Windows::set_icon(const Image& p_icon) { /* Create temporary bitmap buffer */ int icon_len = 40 + h * w * 4; - BYTE *icon_bmp = (BYTE*)alloca(icon_len); + Vector<BYTE> v; + v.resize(icon_len); + BYTE *icon_bmp = &v[0]; encode_uint32(40,&icon_bmp[0]); encode_uint32(w,&icon_bmp[4]); @@ -1582,7 +1584,11 @@ bool OS_Windows::has_environment(const String& p_var) const { String OS_Windows::get_environment(const String& p_var) const { - return getenv(p_var.utf8().get_data()); + char* val = getenv(p_var.utf8().get_data()); + if (val) + return val; + + return ""; }; String OS_Windows::get_stdin_string(bool p_block) { |