Return type of bgzf_getc is int, not char
regidx: use size_t, not ssize_t