From 1d02c374c8877d430f4ab35a790fc02f02974704 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 26 May 2010 14:35:22 +0000 Subject: Fixed most of the compilation warnings, and a valgrind warning in the fstring's remove function. memcpy can't do overlapping memory, changed it to use memmove. --- src/tafreader.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'src/tafreader.cpp') diff --git a/src/tafreader.cpp b/src/tafreader.cpp index 012bb32..ca06daf 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp @@ -36,20 +36,30 @@ Bu::TafGroup *Bu::TafReader::readGroup() ws(); FString sName = readStr(); TafGroup *pGroup = new TafGroup( sName ); - ws(); - if( c != ':' ) - throw TafException("%d:%d: Expected ':' got '%c'.", iLine, iCol, c ); - next(); - //printf("Node[%s]:\n", sName.getStr() ); + try + { + ws(); + if( c != ':' ) + throw TafException("%d:%d: Expected ':' got '%c'.", + iLine, iCol, c ); + next(); + //printf("Node[%s]:\n", sName.getStr() ); - groupContent( pGroup ); + groupContent( pGroup ); - if( c != '}' ) - throw TafException("%d:%d: Expected '}' got '%c'.", iLine, iCol, c ); + if( c != '}' ) + throw TafException("%d:%d: Expected '}' got '%c'.", + iLine, iCol, c ); - //next(); + //next(); - return pGroup; + return pGroup; + } + catch(...) + { + delete pGroup; + throw; + } } void Bu::TafReader::groupContent( Bu::TafGroup *pGroup ) -- cgit v1.2.3