Commit 759502ed30574d177b00997e106be22875ad9bd5

Edward Thomson 2019-01-20T20:30:42

odb_loose: explicitly cast to size_t Quiet down a warning from MSVC about how we're potentially losing data. This is safe since we've explicitly tested that it's positive and less than SIZE_MAX.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 649bc56..5bdf884 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -183,7 +183,7 @@ static int parse_header(
 		return -1;
 	}
 
-	out->size = size;
+	out->size = (size_t)size;
 
 	if (GIT_ADD_SIZET_OVERFLOW(out_len, i, 1))
 		goto on_error;