Skip to content

Commit

Permalink
bisect: avoid signed integer overflow
Browse files Browse the repository at this point in the history
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
John Keeping authored and Junio C Hamano committed Apr 3, 2013
1 parent 1599999 commit 7b96d88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ struct commit_list *filter_skipped(struct commit_list *list,
* is increased by one between each call, but that should not matter
* for this application.
*/
static int get_prn(int count) {
static unsigned get_prn(unsigned count) {
count = count * 1103515245 + 12345;
return ((unsigned)(count/65536) % PRN_MODULO);
return (count/65536) % PRN_MODULO;
}

/*
Expand Down

0 comments on commit 7b96d88

Please sign in to comment.