]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/time.cpp
non-PCH build fix (according to Tinderbox).
[wxWidgets.git] / src / msw / wince / time.cpp
index 55613ec1b08e9afcffeb096e544e7fd1bd5aef70..d53f58b69faf136658686accfc632cd25fceeec6 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Marco Cavallini (MCK) - wx@koansoftware.com
 // Modified by:
 // Created:     31-08-2003
-// RCS-ID:
+// RCS-ID:      $Id$
 // Copyright:   (c) Marco Cavallini
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -450,6 +450,7 @@ label:
 
                                if (t->tm_isdst < 0)
                                        continue;
+                continue;
                                if (diff < 0) {
                                        sign = "-";
                                        diff = -diff;
@@ -499,18 +500,20 @@ strftime(char * const s, const size_t maxsize, const char *format, const struct
 extern "C"
 {
 
-size_t wcsftime(wchar_t* const s, const size_t maxsize, const wchar_t *format, const struct tm * const t)
+size_t wcsftime(wchar_t *s,
+                const size_t maxsize,
+                const wchar_t *format,
+                const struct tm *t)
 {
-    char sBuf[256];
-    sBuf[0] = 0;
-    
+    wxCharBuffer sBuf(maxsize/sizeof(wchar_t));
+
     wxString formatStr(format);
     wxCharBuffer bufFormatStr(formatStr.mb_str());
-    
-    size_t sz = strftime(sBuf, maxsize, bufFormatStr, t);
-    
-    wxMB2WC(s, sBuf, strlen(sBuf));
-    
+
+    size_t sz = strftime(sBuf.data(), maxsize/sizeof(wchar_t), bufFormatStr, t);
+
+    wxMB2WC(s, sBuf, maxsize);
+
     return sz;
 }