]> Creatis software - gdcm.git/commitdiff
ENH: Sltightly better code
authormalaterre <malaterre>
Tue, 14 Jun 2005 20:53:19 +0000 (20:53 +0000)
committermalaterre <malaterre>
Tue, 14 Jun 2005 20:53:19 +0000 (20:53 +0000)
src/gdcmValidator.cxx

index 3b9ac39b3fb51330b5fd6846cc13c6efa01ac2ae..8d0e2ac0155a408a43005339af33c4190da4545d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValidator.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/14 20:33:54 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/06/14 20:53:19 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,6 +21,8 @@
 #include "gdcmBinEntry.h"
 #include "gdcmValEntry.h"
 
+#include <sstream>
+
 namespace gdcm 
 {
 
@@ -42,9 +44,12 @@ bool CheckVM(ValEntry *v)
     {
     n = 0;
     }
-  n++; //poteaux / intervalles
+  n++; // number of '\' + 1 == Value Multiplicity
 
-  unsigned int m = atoi(v->GetVM().c_str());
+  unsigned int m;
+  std::istringstream os;
+  os.str( v->GetVM());
+  os >> m;
 
   return n == m;
 }