diff --git a/main.cpp b/main.cpp index 7bab7d4..9c252a2 100644 --- a/main.cpp +++ b/main.cpp @@ -20,6 +20,8 @@ #include #endif +#define LINEBUFFSIZE 1024 + using namespace std; //global variables @@ -397,7 +399,8 @@ int check_ifile_format(string &filename, int gz_flag) { } void RunProcess(void) { - char _ch[256]; string _str="@HD\tVN:1.0\n"; + char _ch[LINEBUFFSIZE]; + string _str="@HD\tVN:1.0\n"; if(out_align_file.size()>4){ if(out_align_file.compare(out_align_file.size()-4,4,".sam")==0) param.out_sam=1; else if (out_align_file.compare(out_align_file.size()-4,4,".bam")==0) param.out_sam=2; @@ -483,11 +486,19 @@ void RunProcess(void) { } if(param.out_sam&¶m.sam_header) { + int ret_len; for(bit32_t i=0;i=LINEBUFFSIZE) { + cerr<<"Buffer error, output was truncated (increase LINEBUFFSIZE in main.cpp and recompile)."<=LINEBUFFSIZE) { + cerr<<"Buffer error, output was truncated (increase LINEBUFFSIZE in main.cpp and recompile)."<=LINEBUFFSIZE) { + cerr<<"Buffer error, output was truncated (increase LINEBUFFSIZE in main.cpp and recompile)."<=LINEBUFFSIZE) { + cerr<<"Buffer error, output was truncated (increase LINEBUFFSIZE in main.cpp and recompile)."<