]> git.donarmstrong.com Git - bamtools.git/commitdiff
Fix invalid json output
authorChase Miller <chmille4@gmail.com>
Wed, 24 Jul 2013 17:02:09 +0000 (13:02 -0400)
committerChase Miller <chmille4@gmail.com>
Wed, 24 Jul 2013 17:02:09 +0000 (13:02 -0400)
add quotes to the filename variable so that the json outputed is valid json

src/toolkit/bamtools_convert.cpp

index b0aae0728a2a840048064e40f720d2bd129433cd..54820e7d01c719b621d4aff9c5c2dd7822bd1d5a 100644 (file)
@@ -423,7 +423,7 @@ void ConvertTool::ConvertToolPrivate::PrintJson(const BamAlignment& a) {
     }
     
     // write alignment's source BAM file
-    m_out << "\"filename\":" << a.Filename << ",";
+    m_out << "\"filename\":\"" << a.Filename << "\",";
 
     // write tag data
     const char* tagData = a.TagData.c_str();