]> git.donarmstrong.com Git - bamtools.git/commitdiff
Major fix in handling tag data in BamAux.h... checking for null characters in BamAlig...
authorbarnett <barnett@9efb377e-2e27-44b9-b91a-ec4abb80ed8b>
Wed, 31 Mar 2010 18:36:11 +0000 (18:36 +0000)
committerbarnett <barnett@9efb377e-2e27-44b9-b91a-ec4abb80ed8b>
Wed, 31 Mar 2010 18:36:11 +0000 (18:36 +0000)
git-svn-id: svn+ssh://gene.bc.edu/home/subversion/Derek/BamTools/trunk@45 9efb377e-2e27-44b9-b91a-ec4abb80ed8b

BamAux.h

index 7ece317ce82b249a42eef99d89201d933582f97b..8e92bea6f22f8d3054db8c2e6799eda01c39f9fc 100644 (file)
--- a/BamAux.h
+++ b/BamAux.h
@@ -143,7 +143,9 @@ struct BamAlignment {
                 }\r
 \r
                 // get the storage class and find the next tag\r
+                if (*pTagStorageType == '\0') { return false; }\r
                 SkipToNextTag( *pTagStorageType, pTagData, numBytesParsed );\r
+                if (*pTagData == '\0') { return false; }\r
             }\r
 \r
             // return if the read group tag was not present\r
@@ -181,7 +183,9 @@ struct BamAlignment {
                 }\r
 \r
                 // get the storage class and find the next tag\r
+                if (*pTagStorageType == '\0') { return false; }\r
                 SkipToNextTag( *pTagStorageType, pTagData, numBytesParsed );\r
+                if (*pTagData == '\0') { return false; }\r
             }\r
             // return if the edit distance tag was not present\r
             if ( !foundEditDistanceTag ) { return false; }\r