]> Git trees. - libqmvoc.git/commitdiff
fix uninitialized accesses (CID 4230)
authorDirk Mueller <mueller@kde.org>
Wed, 21 Nov 2007 23:23:19 +0000 (23:23 +0000)
committerDirk Mueller <mueller@kde.org>
Wed, 21 Nov 2007 23:23:19 +0000 (23:23 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=739822

keduvocdocument/keduvockvtmlreader.cpp

index 65d79712aba440a3112378ec21af02b45031cf9a..c137c2e1a98754e849747ede8d67143307ae1e08 100644 (file)
@@ -224,7 +224,7 @@ bool KEduVocKvtmlReader::readLesson( QDomElement &domElementParent )
     for ( int i = 0; i < entryList.count(); ++i ) {
         currentElement = entryList.item( i ).toElement();
         if ( currentElement.parentNode() == domElementParent ) {
-            int no;
+            int no = -1;
 
             attribute = currentElement.attributeNode( KV_LESS_NO );
             if ( !attribute.isNull() ) {
@@ -233,7 +233,7 @@ bool KEduVocKvtmlReader::readLesson( QDomElement &domElementParent )
 
             attribute = currentElement.attributeNode( KV_LESS_CURR );
             if ( !attribute.isNull() ) {
-                if ( attribute.value().toInt() != 0 ) {
+                if ( no != -1 && attribute.value().toInt() != 0 ) {
                     m_doc->setCurrentLesson( no );
                 }
             }