Skip to content

Commit

Permalink
Address code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriuo committed Apr 28, 2020
1 parent 445de25 commit 27b872f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -3220,8 +3220,10 @@ int sam_format1(const bam_hdr_t *h, const bam1_t *b, kstring_t *str)
// reference count the structure.
int sam_write1(htsFile *fp, const sam_hdr_t *hdr, const bam1_t *b)
{
const sam_hdr_t *h = hdr;
if (!h) h = fp->bam_header;
if (!fp || !b) { errno = EINVAL; return -1; }
const sam_hdr_t *h = hdr ? hdr : fp->bam_header;
if (!h) { hts_log_error("No header available for file \"%s\"", fp->fn); return -1; }

switch (fp->format.format) {
case binary_format:
fp->format.category = sequence_data;
Expand Down
2 changes: 0 additions & 2 deletions vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,8 +3291,6 @@ static int vcf_idx_init(htsFile *fp, bcf_hdr_t *h, int min_shift, const char *fn
u32_to_le(0, conf+20); // n.skip
u32_to_le(0, conf+24); // ref name len
if (hts_idx_set_meta(fp->idx, sizeof(conf)*sizeof(*conf), (uint8_t *)conf, 1) < 0) {
hts_idx_destroy(fp->idx);
fp->idx = NULL;
return -1;
}
fp->fnidx = strdup(fnidx);
Expand Down

0 comments on commit 27b872f

Please sign in to comment.