1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-29 07:26:10 +02:00

ref_update_reject_duplicates(): use `size_t` rather than `int`

Eliminate a theoretical risk of integer overflow if the two types have
different sizes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2017-05-22 16:17:46 +02:00 committed by Junio C Hamano
parent 2ced105cb1
commit a552e50e5a

2
refs.c
View File

@ -1705,7 +1705,7 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
int ref_update_reject_duplicates(struct string_list *refnames,
struct strbuf *err)
{
int i, n = refnames->nr;
size_t i, n = refnames->nr;
assert(err);