Skip to content

Commit

Permalink
Format 'c'-encoded auxiliary fields correctly, as *signed* integers.
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Nov 24, 2009
1 parent 9c60e50 commit 13a7326
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bam.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ char *bam_format1_core(const bam_header_t *header, const bam1_t *b, int of)
ksprintf(&str, "\t%c%c:", key[0], key[1]);
if (type == 'A') { ksprintf(&str, "A:%c", *s); ++s; }
else if (type == 'C') { ksprintf(&str, "i:%u", *s); ++s; }
else if (type == 'c') { ksprintf(&str, "i:%d", *s); ++s; }
else if (type == 'c') { ksprintf(&str, "i:%d", *(int8_t*)s); ++s; }
else if (type == 'S') { ksprintf(&str, "i:%u", *(uint16_t*)s); s += 2; }
else if (type == 's') { ksprintf(&str, "i:%d", *(int16_t*)s); s += 2; }
else if (type == 'I') { ksprintf(&str, "i:%u", *(uint32_t*)s); s += 4; }
Expand Down

0 comments on commit 13a7326

Please sign in to comment.