X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3103e8a97e834e9793f0eb149aa82a99fd64ef9a..86110e1a1917b01b23f5ac7fc0f4270f6d27a188:/src/common/datetime.cpp 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