]> Git trees. - libqmvoc.git/commitdiff
avoid using uninitialized values
authorStephan Kulow <coolo@kde.org>
Thu, 20 Jan 2005 10:53:24 +0000 (10:53 +0000)
committerStephan Kulow <coolo@kde.org>
Thu, 20 Jan 2005 10:53:24 +0000 (10:53 +0000)
svn path=/trunk/kdeedu/libkdeedu/; revision=380365

extdate/extdatetime.cpp
extdate/extdatetime.h

index cf2db4de7500e3a724229f39ef568cb04b75be24..ace14d822eddaebe443b9fbda1fa0af36b19a336 100644 (file)
@@ -145,7 +145,7 @@ void        ExtDate::JDToGregorian( long int jd, int &year, int &month, int &day )
 
 bool ExtDate::isValid() const
 {
-       return ( isValid( year(), month(), day() ) && jd() != INVALID_DAY );
+       return ( jd() != INVALID_DAY && isValid( year(), month(), day() ) );
 }
 
 int ExtDate::dayOfWeek() const
index aac9551967d44a486d9307c93122bf457533d81d..3246593cc34e75e308e887fd3fbe5e9916d5974d 100644 (file)
@@ -33,7 +33,7 @@ extern        void test2_unit(int y, int m, int d);
 class KDE_EXPORT ExtDate
 {
 public:
-       ExtDate() { m_jd = INVALID_DAY; }
+       ExtDate() : m_jd(INVALID_DAY), m_year(0), m_month(0), m_day(0) {}
        ExtDate( int y, int m, int d );
        ExtDate( const QDate &q ) { ExtDate( q.year(), q.month(), q.day() ); }
        ExtDate( long int jd );