Skip to content

Commit 0fda84f

Browse files
committed
Copy over a lib2bit fix for #4, bump to 0.2.1
1 parent 9844de6 commit 0fda84f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib2bit/2bit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void bytes2bases(char *seq, uint8_t *byte, uint32_t sz, int offset) {
7272
while(offset < 4) {
7373
seq[pos++] = byte2base(foo, offset++);
7474
}
75+
if(pos >= sz) return;
7576
foo = byte[++i];
7677
}
7778

@@ -158,9 +159,10 @@ void softMask(char *seq, TwoBit *tb, uint32_t tid, uint32_t start, uint32_t end)
158159
*/
159160
char *constructSequence(TwoBit *tb, uint32_t tid, uint32_t start, uint32_t end) {
160161
uint32_t sz = end - start + 1;
161-
uint32_t blockStart, blockEnd, offset;
162+
uint32_t blockStart, blockEnd;
162163
char *seq = malloc(sz * sizeof(char));
163164
uint8_t *bytes = NULL;
165+
int offset;
164166
if(!seq) return NULL;
165167

166168
//There are 4 bases/byte

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
include_dirs = ['lib2bit', sysconfig.get_config_var("INCLUDEPY")])
1818

1919
setup(name = 'py2bit',
20-
version = '0.2.0',
20+
version = '0.2.1',
2121
description = 'A package for accessing 2bit files using lib2bit',
2222
author = "Devon P. Ryan",
2323
author_email = "ryan@ie-freiburg.mpg.de",
2424
url = "https://github.com/dpryan79/py2bit",
2525
license = "MIT",
26-
download_url = "https://github.com/dpryan79/py2bit/tarball/0.2.0",
26+
download_url = "https://github.com/dpryan79/py2bit/tarball/0.2.1",
2727
keywords = ["bioinformatics", "2bit"],
2828
classifier = ["Development Status :: 5 - Production/Stable",
2929
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)