]> git.saurik.com Git - wxWidgets.git/commitdiff
return empty string instead of some garbage if strftime() failed
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2008 14:34:43 +0000 (14:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Aug 2008 14:34:43 +0000 (14:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datetime.cpp

index f6ad3f6259ab5fd94d548c220cdf7d9029b301f6..8bd4933a187b83f9ecbb48717bdfa58ebd455e54 100644 (file)
@@ -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;