From adec277f047c509e139fab6ff4e434b845b7e426 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Aug 2008 14:34:43 +0000 Subject: [PATCH] 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 --- src/common/datetime.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.45.2