Skip to content

Commit

Permalink
Fix one more ASAN issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jayhesselberth committed Dec 23, 2024
1 parent 5c900b3 commit 5d53902
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cpp11bigwig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,14 @@ writable::data_frame read_bigbed_cpp(std::string bbfname, sexp chrom, sexp start

[[cpp11::register]]
std::string bigbed_sql_cpp(std::string bbfname) {
std::vector<char> bbfile(bbfname.begin(), bbfname.end()) ;
bbfile.push_back('\0') ;

const char* bbfile = bbfname.c_str() ;
const char mode = 'r' ;

bigWigFile_t *bbf = NULL;

// NULL can be a CURL callback. see libBigWig demos
bbf = bwOpen(&bbfile[0], NULL, &mode) ;
bbf = bwOpen(bbfile, NULL, &mode) ;

if (!bbf)
stop("Failed to open file: '%s'\n", bbfname.c_str()) ;
Expand Down

0 comments on commit 5d53902

Please sign in to comment.