[maq-help] maqview 0.2.5 crashes on 32-bit systems [PATCH]
Status: Beta
Brought to you by:
lh3lh3
From: Shaun J. <sja...@bc...> - 2008-12-31 19:38:44
|
maqview 0.2.5 crashes on 32-bit systems due to a bug in handle_mouse_over. It uses an incorrect format (%ld) to print a int64_t, which is not a long int on all systems. The solution is to either cast the argument to a long int, or change the format to PRId64, defined in inttypes.h, which is the correct format for a int64_t type. Alternatively, you could use a type of ssize_t for read_pos arguments and use the format %zd (or size_t and %zu). Cheers, Shaun diff -ur maqview-0.2.5.orig/view_panel.c maqview-0.2.5/view_panel.c --- maqview-0.2.5.orig/view_panel.c 2008-08-15 21:15:37.000000000 -0700 +++ maqview-0.2.5/view_panel.c 2008-12-31 11:31:20.315585000 -0800 @@ -1129,11 +1129,11 @@ if (read->read.seq[id] == 0) ch = 'n'; else if (q < 27) ch = acgt[read->read.seq[id]>>6&3]; else ch = ACGT[read->read.seq[id]>>6&3]; - sprintf(vp->err_string, "Read: %ld|%c|%s[%d]|%c %d", read_pos(read->read.pos) + 1, + sprintf(vp->err_string, "Read: %ld|%c|%s[%d]|%c %d", (long)read_pos(read->read.pos) + 1, read_strand(read->read.pos)? '-':'+', read->read.name, id + 1, ch, q); return; case VIEW_MODE_LINE: - sprintf(vp->err_string, "Read: %ld|%c|%s", read_pos(read->read.pos) + 1, + sprintf(vp->err_string, "Read: %ld|%c|%s", (long)read_pos(read->read.pos) + 1, read_strand(read->read.pos)? '-':'+', read->read.name); return; } |