diff --git a/bigWig.h b/bigWig.h index dbfba02..88e1961 100644 --- a/bigWig.h +++ b/bigWig.h @@ -56,7 +56,7 @@ extern "C" { /*! * The library version number */ -#define LIBBIGWIG_VERSION 0.4.9 +#define LIBBIGWIG_VERSION 0.4.10 /*! * If 1, then this library was compiled with remote file support. diff --git a/bwWrite.c b/bwWrite.c index d17d152..1a9c7a9 100644 --- a/bwWrite.c +++ b/bwWrite.c @@ -544,7 +544,7 @@ int bwAddIntervalSpanSteps(bigWigFile_t *fp, const char *chrom, uint32_t start, updateStats(fp, wb->span, values[i]); wb->l += 4; } - wb->end = wb->start + (wb->l>>2) * step; + wb->end = wb->start + ((wb->l-24)>>2) * step; return 0; } @@ -567,7 +567,7 @@ int bwAppendIntervalSpanSteps(bigWigFile_t *fp, const float *values, uint32_t n) updateStats(fp, wb->span, values[i]); wb->l += 4; } - wb->end = wb->start + (wb->l>>2) * wb->step; + wb->end = wb->start + ((wb->l-24)>>2) * wb->step; return 0; } diff --git a/io.c b/io.c index 9b20b1a..96c0565 100644 --- a/io.c +++ b/io.c @@ -209,6 +209,11 @@ URL_t *urlOpen(const char *fname, CURLcode (*callBack)(CURL*), const char *mode) fprintf(stderr, "[urlOpen] Failed instructing curl to use any HTTP authentication it finds to be suitable!\n"); goto error; } + // set user-agent + if(curl_easy_setopt(URL->x.curl, CURLOPT_USERAGENT, "libBigWig") != CURLE_OK) { + fprintf(stderr, "[urlOpen] Failed instructing curl to use libBigWig as a user-agent!\n"); + goto error; + } //Follow redirects if(curl_easy_setopt(URL->x.curl, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) { fprintf(stderr, "[urlOpen] Failed instructing curl to follow redirects!\n"); diff --git a/test/test.py b/test/test.py index d79d32d..4a60516 100755 --- a/test/test.py +++ b/test/test.py @@ -42,7 +42,7 @@ def test_creation_from_scratch(): assert p1 == 0 with open(tmpout, mode="rb") as f: md5sum = hashlib.md5(f.read()).hexdigest() - assert md5sum == "ef104f198c6ce8310acc149d0377fc16" + assert md5sum == "c07d7b09a0e370f3caca50258c5a6957" def remote_test2():