From: Robert Roebling Date: Sun, 11 Aug 2002 16:17:23 +0000 (+0000) Subject: Corrected dangerous cast. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c35c94f6cd6bba8462155cf7239a03f33640ee17 Corrected dangerous cast. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index f8ef9b471f..fd4b6b7ae9 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1415,8 +1415,11 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) bool needsANSI = TRUE; #if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU - wxCharBuffer c_buffer(sz); - char *cbuf = (char*)(const char*)c_buffer; + // This is not legal code as the compiler + // is allowed destroy the wxCharBuffer. + // wxCharBuffer c_buffer(sz); + // char *cbuf = (char*)(const char*)c_buffer; + char cbuf[_MAXPATHLEN]; #endif #ifdef HAVE_WGETCWD