Skip to content

Commit

Permalink
Fix issues found with Coverity Scan
Browse files Browse the repository at this point in the history
  • Loading branch information
noporpoise committed Nov 1, 2015
1 parent c8132c0 commit 24d0114
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
# Instead we use a script to decide if we should do anything

language: c
compiler: gcc
os: linux
compiler:
- clang
- gcc
os:
- linux
- osx

sudo: false

Expand Down
2 changes: 1 addition & 1 deletion libs/carrays
Submodule carrays updated 1 files
+2 −0 runtests.c
2 changes: 1 addition & 1 deletion libs/readsim
Submodule readsim updated 2 files
+135 −100 seq_file.h
+160 −97 stream_buffer.h
2 changes: 1 addition & 1 deletion libs/seq-align
2 changes: 1 addition & 1 deletion libs/string_buffer
Submodule string_buffer updated 1 files
+1 −1 string_buffer.c
4 changes: 2 additions & 2 deletions src/basic/file_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ bool futil_is_file_readable(const char *file);
bool futil_is_file_writable(const char *file);
off_t futil_get_file_size(const char* filepath);

#define futil_outpath_str(path) (strcmp(path,"-") == 0 ? "STDOUT" : (path))
#define futil_inpath_str(path) (strcmp(path,"-") == 0 ? "STDIN" : (path))
#define futil_outpath_str(path) (!(path) || strcmp(path,"-") == 0 ? "STDOUT" : (path))
#define futil_inpath_str(path) (!(path) ||strcmp(path,"-") == 0 ? "STDIN" : (path))

/*!
Create file and parent directories
Expand Down
8 changes: 2 additions & 6 deletions src/commands/ctx_dist_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,8 @@ int ctx_dist_matrix(int argc, char **argv)
fprintf(fout, "\n");
}

if(out_path && strcmp(out_path,"-") != 0) {
status("[dist_matrix] written to %s", out_path);
fclose(fout);
} else {
status("[dist_matrix] written to STDOUT");
}
status("[dist_matrix] written to %s", futil_outpath_str(out_path));
fclose(fout);

for(i = 0; i < nthreads; i++)
ctx_free(workers.matrices[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ctx_vcfgeno.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ int ctx_vcfgeno(int argc, char **argv)
ctx_free(err_rates);
ctx_free(log_errs);
ctx_free(kcovgs);
for(r = 0; r < nseqs; r++) ctx_free(ploidy_mat[0]);
for(r = 0; r < nseqs; r++) ctx_free(ploidy_mat[r]);
ctx_free(ploidy_mat);

math_calcs_destroy();
Expand Down

0 comments on commit 24d0114

Please sign in to comment.