From: malaterre Date: Mon, 19 Jul 2004 05:57:20 +0000 (+0000) Subject: BUG: There was two bombs at the same time. Guess what what I found them all X-Git-Tag: Version0.5.bp~46 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0a7355e1aaeeabadba3e464bdef81bcff5777d37;p=gdcm.git BUG: There was two bombs at the same time. Guess what what I found them all --- 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);