]> Creatis software - gdcm.git/commitdiff
Never trust optimiser!
authorjpr <jpr>
Fri, 22 Jun 2007 10:02:48 +0000 (10:02 +0000)
committerjpr <jpr>
Fri, 22 Jun 2007 10:02:48 +0000 (10:02 +0000)
Thx to Eduardo Davila for reporting the bug.
(failed on MSVC6)

src/gdcmVR.cxx

index 48f53b3543dc7b064f7cfd2d2d1da5ee37ec8d71..19596be9470c2e6d39ec0f035cb533df61281a6d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/05/23 14:18:11 $
-  Version:   $Revision: 1.55 $
+  Date:      $Date: 2007/06/22 10:02:48 $
+  Version:   $Revision: 1.56 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -177,9 +177,13 @@ bool VR::IsValidVR(VRKey const &tested)
   const char *pt = VRvalues;
   for (int i=0;i<nbVal;i++)
   {
-     if(tested[0] == *pt++)
+     if(tested[0] == *pt++) {
        if(tested[1] == *pt++)
-          return true;       
+          return true;
+     }  
+     else {
+        pt++;
+     }        
   }
   return false;