Commit 52ca4f8a3992a8ca1672abb6263455f01a03549b

Carlos Martín Nieto 2011-04-11T17:51:05

Use internal strtol Signed-off-by: Carlos Martín Nieto <cmn@elego.de>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/config.c b/src/config.c
index 6b4007d..9e62df0 100644
--- a/src/config.c
+++ b/src/config.c
@@ -386,12 +386,9 @@ int git_config_get_long(git_config *cfg, const char *name, long int *out)
 	if (ret < GIT_SUCCESS)
 		return ret;
 
-	errno = 0;
-	num = strtol(value, &num_end, 0);
-
-	/* There was some error */
-	if (num_end == value || errno != 0)
-		return GIT_EINVALIDTYPE;
+	ret = git__strtol32(&num, value, &num_end, 0);
+	if (ret < GIT_SUCCESS)
+		return ret;
 
 	switch (*num_end) {
 	case '\0':