From: John Keeping Date: Wed, 3 Apr 2013 19:17:55 +0000 (+0100) Subject: bisect: avoid signed integer overflow X-Git-Tag: v1.8.2.2~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b96d8880252d70c334857f80ef54009133dbaf3;p=thirdparty%2Fgit.git bisect: avoid signed integer overflow Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- diff --git a/bisect.c b/bisect.c index 1aad49b1a6..7f95273e69 100644 --- 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; } /*