From: Vadim Zeitlin Date: Sun, 3 Aug 2008 14:34:43 +0000 (+0000) Subject: return empty string instead of some garbage if strftime() failed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/adec277f047c509e139fab6ff4e434b845b7e426 return empty string instead of some garbage if strftime() failed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index f6ad3f6259..8bd4933a18 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -487,8 +487,10 @@ static wxString CallStrftime(const wxString& format, const tm* tm) if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) ) { - // buffer is too small? + // if the format is valid, buffer must be too small? wxFAIL_MSG(_T("strftime() failed")); + + buf[0] = '\0'; } s = buf;