Bug 94935 - Comparison of unsigned expression >= 0 is always true
Summary: Comparison of unsigned expression >= 0 is always true
Status: RESOLVED FIXED
Alias: None
Product: kvoctrain
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Hedlund
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-11 18:02 UTC by Marcin Garski
Modified: 2004-12-26 22:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
VocabBox (13.32 KB, application/x-tar)
2004-12-18 00:06 UTC, Marcin Garski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Garski 2004-12-11 18:02:28 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

In kvt-core/kvd_vcb.cpp file there is if statement:

if (s.stripWhiteSpace().length() >= 0) {
        tdate = s.toInt();
}

This is a comparison of unsigned expression >= 0 that is always true.

IMHO this test is pointless and should be removed.
Comment 1 Peter Hedlund 2004-12-17 22:34:57 UTC
I agree that the test most likely can just be removed. However, if you have a Vocabbox file available I would like to have it for testing purposes (attach to this bug report). The Vocabbox program seems to no longer be available.
Comment 2 Marcin Garski 2004-12-18 00:06:59 UTC
Created attachment 8706 [details]
VocabBox
Comment 3 Marcin Garski 2004-12-18 00:09:33 UTC
I've found VocabBox sources (in README you can find how to create vocabulary file). Is it ok, or should I search vocabulary file?
Comment 4 Peter Hedlund 2004-12-26 22:31:40 UTC
CVS commit by hedlund: 

Correct import of Vocabbox files.
BUG:94935


  M +15 -17    kvd_vcb.cpp   1.10


--- kdeedu/kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp  #1.9:1.10
@@ -1,6 +1,4 @@
 /***************************************************************************
 
-    $Id$
-
                    maintain a document in vocabbox format
 
@@ -9,7 +7,7 @@
     begin                : Thr Mar 23 21:00:53 MET 1999
                                            
-    copyright            : (C) 1999-2001 Ewald Arnold
+    copyright      : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
                            (C) 2001 The KDE-EDU team
-    email                : kvoctrain@ewald-arnold.de
+                     (C) 2004 Peter Hedlund <peter@peterandlinda.com>
 
     -----------------------------------------------------------------------
@@ -160,5 +158,5 @@ bool kvoctrainDoc::loadFromVcb (QTextStr
       }
  
-      if (s.stripWhiteSpace().length() >= 0) {
+      if (s.stripWhiteSpace().length() > 0) {
         tdate = s.toInt();
       }