X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d595fb29c93249b72930cad9a85a5c237a8ceff7..ccb5db57cdb1766eefb7023dda50ede9f0d01f78:/src/common/dbtable.cpp diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index 7824b72820..5463713419 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -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)