]> Creatis software - gdcm.git/commitdiff
ENH: Remove one more sprintf
authormalaterre <malaterre>
Sat, 9 Oct 2004 03:36:56 +0000 (03:36 +0000)
committermalaterre <malaterre>
Sat, 9 Oct 2004 03:36:56 +0000 (03:36 +0000)
src/gdcmDocument.cxx
src/gdcmDocument.h

index 9d3d59ea0717c461339377ef9e3acd388e8d540d..495b15b3489c80105da0488f6600e897efc5ae4c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/08 08:38:54 $
-  Version:   $Revision: 1.98 $
+  Date:      $Date: 2004/10/09 03:36:56 $
+  Version:   $Revision: 1.99 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -33,7 +33,7 @@
    #include <netinet/in.h>
 #endif
 
-#  include <iomanip>
+#include <iomanip>
 
 // Implicit VR Little Endian
 #define UI1_2_840_10008_1_2      "1.2.840.10008.1.2"
@@ -1951,7 +1951,7 @@ void gdcmDocument::FindDocEntryVR( gdcmDocEntry *entry )
 */
 bool gdcmDocument::CheckDocEntryVR(gdcmDocEntry *entry, gdcmVRKey vr)
 {
-   char msg[100]; // for sprintf
+   std::string msg;
    bool realExplicit = true;
 
    // Assume we are reading a falsely explicit VR file i.e. we reached
@@ -1979,9 +1979,9 @@ bool gdcmDocument::CheckDocEntryVR(gdcmDocEntry *entry, gdcmVRKey vr)
    {
       // We thought this was explicit VR, but we end up with an
       // implicit VR tag. Let's backtrack.   
-      sprintf(msg,"Falsely explicit vr file (%04x,%04x)\n", 
-                   entry->GetGroup(), entry->GetElement());
-      dbg.Verbose(1, "gdcmDocument::FindVR: ",msg);
+      msg = Format("Falsely explicit vr file (%04x,%04x)\n", 
+                    entry->GetGroup(), entry->GetElement());
+      dbg.Verbose(1, "gdcmDocument::FindVR: ", msg.c_str());
 
       if( entry->GetGroup() % 2 && entry->GetElement() == 0x0000)
       {
index c499c6a0ae0d38645073fbd63eeb985698ef4181..86e86b26ee7ef01d9be70933075d405e1bcfba6a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/06 21:30:02 $
-  Version:   $Revision: 1.47 $
+  Date:      $Date: 2004/10/09 03:36:57 $
+  Version:   $Revision: 1.48 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include "gdcmDictSet.h"
 #include "gdcmDocEntry.h"
 #include "gdcmRLEFramesInfo.h"
+#include "gdcmDocEntrySet.h"
+#include "gdcmElementSet.h"
 
 class gdcmValEntry;
 class gdcmBinEntry;
 class gdcmSeqEntry;
 
-#include "gdcmDocEntrySet.h"
-#include "gdcmElementSet.h"
-
 #include <map>
 #include <list>