From 594588aa22af836b9ad1badb774ecf44aef130b7 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Thu, 2 Jun 2005 07:47:57 +0000 Subject: [PATCH] Work around mingw/cygwin bug 1046059 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 8b55ee465b..b09fe1ef75 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -376,13 +376,18 @@ static long GetTruncatedJDN(wxDateTime::wxDateTime_t day, static wxString CallStrftime(const wxChar *format, const tm* tm) { wxChar buf[4096]; + // Create temp wxString here to work around mingw/cygwin bug 1046059 + // http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1046059&group_id=2435 + wxString s; + if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) ) { // buffer is too small? wxFAIL_MSG(_T("strftime() failed")); } - return wxString(buf); + s = buf; + return s; } #endif -- 2.45.2