Commit db6b8f7db1973ad874a8ec1d147ad8e98e65d9cb

Edward Thomson 2019-05-21T14:15:58

strtol: cast error message length to int

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/util.c b/src/util.c
index 48cbc13..316a289 100644
--- a/src/util.c
+++ b/src/util.c
@@ -192,7 +192,7 @@ int git__strntol32(int32_t *result, const char *nptr, size_t nptr_len, const cha
 
 	tmp_int = tmp_long & 0xFFFFFFFF;
 	if (tmp_int != tmp_long) {
-		int len = tmp_endptr - nptr;
+		int len = (int)(tmp_endptr - nptr);
 		git_error_set(GIT_ERROR_INVALID, "failed to convert: '%.*s' is too large", len, nptr);
 		return -1;
 	}