From 0a7355e1aaeeabadba3e464bdef81bcff5777d37 Mon Sep 17 00:00:00 2001 From: malaterre Date: Mon, 19 Jul 2004 05:57:20 +0000 Subject: [PATCH] BUG: There was two bombs at the same time. Guess what what I found them all --- src/gdcmDocument.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 92a42e3d..62b2339c 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -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); -- 2.46.1