avoid buffer overrun

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-02-28 18:35:34 +00:00
parent 6a7dd4b3ab
commit 10a2749bd7

View File

@@ -935,7 +935,7 @@ void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm)
// assert, even though it is a perfectly legal use.
if ( am )
{
if (wxStrftime(buffer, sizeof buffer, _T("%p"), &tm) > 0)
if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
*am = wxString(buffer);
else
*am = wxString();
@@ -943,7 +943,7 @@ void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm)
if ( pm )
{
tm.tm_hour = 13;
if (wxStrftime(buffer, sizeof buffer, _T("%p"), &tm) > 0)
if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0)
*pm = wxString(buffer);
else
*pm = wxString();