Skip to content

Commit dae5ca3

Browse files
Russell StewartRussell Stewart
authored andcommitted
Merge pull request #3 from SergeyDidenko/shuffle_fix
fixed shuffle call to obey array boundaries
2 parents 1fe65b0 + 78aba8e commit dae5ca3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shuffle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int shuffle_by_chunks() {
164164
if(feof(fin)) break;
165165
i++;
166166
}
167-
shuffle(array, i-1); //Last chunk may be smaller than array_size
167+
shuffle(array, i-2); //Last chunk may be smaller than array_size
168168
write_chunk(array,i,fid);
169169
l += i;
170170
if(verbose > 1) fprintf(stderr, "\033[22Gprocessed %ld lines.\n", l);

0 commit comments

Comments
 (0)