Skip to content

Commit

Permalink
fix constants in currently unused snpsortit
Browse files Browse the repository at this point in the history
fix overflow bug when reading transpose packed data files > int size
  • Loading branch information
MatthewMah committed Sep 6, 2024
1 parent 37b9ab9 commit b10ddcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ADMIXTOOLS version 8.0.1 8/15/24 (for Linux and Mac)
ADMIXTOOLS version 8.0.2 9/06/24 (for Linux and Mac)

See README.INSTALL for installation info.

Expand Down Expand Up @@ -108,6 +108,7 @@ See ./transpose_info and ./convertf/README
The key code for this was written by Matthew Mah

Version 8.0.1 is a minor bugfix release.
Version 8.0.2 is a minor bugfix release, affecting transpose packed files > 2GB.

----------------------------
SOFTWARE COPYRIGHT NOTICE AGREEMENT
Expand Down
8 changes: 4 additions & 4 deletions src/mcio.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ snpsortit (int **spos, int *indx, int n)
int i, base[3];

base[0] = 1;
base[1] = 10 ^ 8;
base[2] = 10 ^ 9;
base[1] = pow(10.0, 8) ;
base[2] = pow(10.0, 9) ;

ZALLOC (lkode, n, long);
for (i = 0; i < n; i++) {
Expand Down Expand Up @@ -2954,7 +2954,7 @@ inpackt (char *gname, SNP ** snpm, Indiv ** indiv, int numsnps, int numind)
int fdes, ret;
char *packit, *pbuff;
int trlen ; // length of input record
int offset ;
long offset ;
int *indmap, x, numoutind ;
int numread = 0 ;

Expand Down Expand Up @@ -3031,7 +3031,7 @@ inpackt (char *gname, SNP ** snpm, Indiv ** indiv, int numsnps, int numind)
// this is key main program must set Indiv array appropriately
// jnum = indmap[j] ;
jnum = j ;
offset = j*trlen + GENO_HEADER_SIZE ;
offset = ((long) j) * trlen + GENO_HEADER_SIZE ;
lseek(fdes, offset, SEEK_SET);
t = read (fdes, buff, trlen);
if (t != trlen) {
Expand Down

0 comments on commit b10ddcf

Please sign in to comment.