Skip to content

Commit

Permalink
Fix crash reported in #26
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanxw committed Jan 25, 2023
1 parent 08eea5b commit bd02841
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ inline void log_error(const char* s) {
#endif

inline void REPORT(const char* x) {
REprintf("Report '%s' to [email protected]\n", x );
REprintf("Report '%s' at https://github.com/zhanxw/seqminer\n", x );
}

inline void FATAL(const char* x) {
Expand Down
2 changes: 1 addition & 1 deletion src/FileIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AbstractFileReader* AbstractFileReader::open(const char* fileName) {
#ifdef _USE_KNETFILE
if (strstr(fileName, "ftp://") == fileName || strstr(fileName, "http://") == fileName) {
fr = new KnetFileReader(fileName);
REprintf("open knetfile %s\n", fileName);
REprintf("Open knetfile %s:%d: [ %s ]\n", __FILE__, __LINE__, fileName);
return fr;
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/FileIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ class KnetFileReader : public AbstractFileReader {
// check eof
bool isEof() {
// this is always false, as we don't know the exact file size
if (!this->fp) { // probably files are not openned
return true;
}
return bgzf_check_EOF(this->fp);
}
// open
Expand Down
8 changes: 6 additions & 2 deletions src/VCFInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ void VCFInputFile::rewriteVCFHeader() {
s += '\t';
s += people[i]->getName();
}
this->header[this->header.size()-1] = s;
if (this->header.size()) {
this->header[this->header.size()-1] = s;
} else {
REprintf("[ERROR] Cannot rewriteVCFHeader() at %s:%d", __FILE__, __LINE__);
}
}

void VCFInputFile::setRangeMode() {
if (mode == VCF_LINE_MODE) {
this->tabixReader = new TabixReader(this->fileName);
if (!this->tabixReader->good()) {
REprintf( "[ERROR] Cannot read VCF by range, please check your have index (or create one use tabix).\nQuitting...");
REprintf("[ERROR] Cannot read VCF by range, please check your have index (or create one use tabix).\nQuitting...");
//abort();
return;
} else {
Expand Down

0 comments on commit bd02841

Please sign in to comment.