Fix compilation in MinGW
diff --git a/src/index.c b/src/index.c
index f20c2a7..bbe9efa 100644
--- a/src/index.c
+++ b/src/index.c
@@ -706,7 +706,7 @@
 			long tmp;
 
 			if (git__strtol32(&tmp, buffer, &endptr, 8) < GIT_SUCCESS ||
-				!endptr || endptr == buffer || *endptr || tmp > UINT_MAX)
+				!endptr || endptr == buffer || *endptr || (unsigned)tmp > UINT_MAX)
 				return GIT_ERROR;
 
 			lost->mode[i] = tmp;
diff --git a/src/win32/posix.c b/src/win32/posix.c
index 2d7b839..be6a7c0 100644
--- a/src/win32/posix.c
+++ b/src/win32/posix.c
@@ -236,16 +236,13 @@
 
 int p_mkstemp(char *tmp_path)
 {
-	int r;
-
 #if defined(_MSC_VER)
-	r = _mktemp_s(tmp_path, GIT_PATH_MAX);
-#else
-	r = _mktemp(tmp_path);
-#endif
-
-	if (r != 0)
+	if (_mktemp_s(tmp_path, GIT_PATH_MAX) != 0)
 		return GIT_EOSERR;
+#else
+	if (_mktemp(tmp_path) == NULL)
+		return GIT_EOSERR;
+#endif
 
 	return p_creat(tmp_path, 0744);
 }