]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dbtable.cpp
compilation fix: wxGenericCollapsiblePane needs wxButton and wxStaticLine
[wxWidgets.git] / src / common / dbtable.cpp
index 7824b7282065e3ed163c80f6e92329a5cdaf0d65..54637134197428520161af9e2d0c4887bd01b059 100644 (file)
@@ -65,7 +65,7 @@ ULONG lastTableID = 0;
 
 void csstrncpyt(wxChar *target, const wxChar *source, int n)
 {
-    while ( (*target++ = *source++) != '\0' && --n )
+    while ( (*target++ = *source++) != '\0' && --n != 0 )
         ;
 
     *target = '\0';
@@ -2244,6 +2244,20 @@ void wxDbTable::ClearMemberVar(UWORD colNumber, bool setToNull)
             pDt->second = 0;
             pDt->fraction = 0;
             break;
+        case SQL_C_DATE:
+            DATE_STRUCT *pDtd;
+            pDtd = (DATE_STRUCT *) colDefs[colNumber].PtrDataObj;
+            pDtd->year = 0;
+            pDtd->month = 0;
+            pDtd->day = 0;
+            break;
+        case SQL_C_TIME:
+            TIME_STRUCT *pDtt;
+            pDtt = (TIME_STRUCT *) colDefs[colNumber].PtrDataObj;
+            pDtt->hour = 0;
+            pDtt->minute = 0;
+            pDtt->second = 0;
+            break;
     }
 
     if (setToNull)