@@ -239,7 +239,7 @@ tag_with_mut(const uint32_t tag, const bool mut) {
239239
240240
241241static void
242- write_output (const bamxx::bam_header &hdr, bamxx::bam_bgzf &out,
242+ write_output (const bamxx::bam_header &hdr, bamxx::bgzf_file &out,
243243 const int32_t tid, const string &chrom,
244244 const vector<CountSet> &counts, bool CPG_ONLY) {
245245
@@ -267,8 +267,7 @@ write_output(const bamxx::bam_header &hdr, bamxx::bam_bgzf &out,
267267 << tag_values[tag_with_mut (the_tag, mut)] << ' \t '
268268 << (n_reads > 0 ? unconverted/n_reads : 0.0 ) << ' \t '
269269 << n_reads << ' \n ' ;
270- const size_t expected_size = buf.tellp ();
271- if (out.write (buf.c_str (), expected_size))
270+ if (!out.write (buf.c_str (), buf.tellp ()))
272271 throw dnmt_error (" error writing output" );
273272 }
274273 }
@@ -397,7 +396,7 @@ process_reads(const bool VERBOSE,
397396
398397 // open the output file
399398 const string output_mode = compress_output ? " w" : " wu" ;
400- bamxx::bam_bgzf out (outfile, output_mode);
399+ bamxx::bgzf_file out (outfile, output_mode);
401400 if (!out) throw dnmt_error (" error opening output file: " + outfile);
402401
403402 /* set the threads for the input file decompression */
0 commit comments