]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid buffer overrun
authorRobin Dunn <robin@alldunn.com>
Mon, 28 Feb 2005 18:35:34 +0000 (18:35 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 28 Feb 2005 18:35:34 +0000 (18:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datetime.cpp

index 6db78ecd41fdda2352a42257678cc2cd5821d299..ba9419b5c786ad6969968a13c42e6561e3503a3d 100644 (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();