bisect: avoid signed integer overflow
authorJohn Keeping <john@keeping.me.uk>
Wed, 3 Apr 2013 19:17:55 +0000 (20:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2013 19:49:14 +0000 (12:49 -0700)
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c
index 1aad49b1a642a308f449001960958ccab79347d1..7f95273e699418bd8a4c11ed6491eb8b6da434dc 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -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;
 }
 
 /*