Browse Source

bisect: avoid signed integer overflow

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
John Keeping 12 years ago committed by Junio C Hamano
parent
commit
7b96d88802
  1. 4
      bisect.c

4
bisect.c

@ -525,9 +525,9 @@ struct commit_list *filter_skipped(struct commit_list *list, @@ -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;
}

/*

Loading…
Cancel
Save