]> Creatis software - gdcm.git/commitdiff
BUG: There was two bombs at the same time. Guess what what I found them all
authormalaterre <malaterre>
Mon, 19 Jul 2004 05:57:20 +0000 (05:57 +0000)
committermalaterre <malaterre>
Mon, 19 Jul 2004 05:57:20 +0000 (05:57 +0000)
src/gdcmDocument.cxx

index 92a42e3dfae510f1d78af469b9d371f4c1766fdb..62b2339c575cceb4cfb94942fde16baff1a3b634 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/19 04:15:41 $
-  Version:   $Revision: 1.52 $
+  Date:      $Date: 2004/07/19 05:57:20 $
+  Version:   $Revision: 1.53 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -321,12 +321,12 @@ bool gdcmDocument::IsGivenTransferSyntax(std::string const & syntaxToCheck)
       // The actual transfer (as read from disk) might be padded. We
       // first need to remove the potential padding. We can make the
       // weak assumption that padding was not executed with digits...
-//      while ( ! isdigit(transfer[transfer.length()-1]) )
-//      {
-//         transfer.erase(transfer.length()-1, 1);
-//      }
-//      if ( transfer == syntaxToCheck )
-      if( transfer.find( syntaxToCheck ) )   //should be faster
+      while ( ! isdigit(transfer[transfer.length()-1]) )
+      {
+         transfer.erase(transfer.length()-1, 1);
+      }
+      if ( transfer == syntaxToCheck )
+      //if( transfer.find( syntaxToCheck ) )   //should be faster
       {
          return true;
       }
@@ -2539,15 +2539,15 @@ void gdcmDocument::SetMaxSizePrintEntry(long newSize)
  */
 gdcmDocEntry *gdcmDocument::ReadNextDocEntry()
 {
+   uint16_t g = ReadInt16();
+   uint16_t n = ReadInt16();
+
    if (errno == 1)
    {
       // We reached the EOF (or an error occured) therefore 
       // header parsing has to be considered as finished.
       return 0;
    }
-
-   uint16_t g = ReadInt16();
-   uint16_t n = ReadInt16();
    gdcmDocEntry *newEntry = NewDocEntryByNumber(g, n);
 
    FindDocEntryVR(newEntry);