Commit 78c34af016dc69e7553e671ad3795ffb9dbb93ef

Matti Virolainen 2015-03-06T12:23:14

Use secure API if available.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index b8b4f43..544b1eb 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -55,7 +55,7 @@ int p_ftruncate(int fd, git_off_t size)
 		return -1;
 	}
 
-#if !defined(__MINGW32__)
+#if !defined(__MINGW32__) || defined(MINGW_HAS_SECURE_API)
 	return ((_chsize_s(fd, size) == 0) ? 0 : -1);
 #else
 	/* TODO MINGW32 Find a replacement for _chsize() that handles big files. */