From c35c94f6cd6bba8462155cf7239a03f33640ee17 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 11 Aug 2002 16:17:23 +0000 Subject: [PATCH] Corrected dangerous cast. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.47.2