From c43fb7fe2367a1b3a8ba76cf66212aa517a46e2d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 12 Mar 2009 15:25:10 +0100 Subject: [PATCH] MinGW: fix signature of CreateHardLinkA() If the declaration of CreateHardLinkA() does not contain the magic word "WINAPI", the stack will be clobbered in the error case. This fixes msysGit issue 204. Signed-off-by: Johannes Schindelin --- compat/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index c011754023..71e12dd478 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1122,7 +1122,7 @@ static int err_win_to_posix(DWORD winerr) int link(const char *oldpath, const char *newpath) { - typedef BOOL (*T)(const char*, const char*, LPSECURITY_ATTRIBUTES); + typedef BOOL WINAPI (*T)(LPCTSTR, LPCTSTR, LPSECURITY_ATTRIBUTES); static T create_hard_link = NULL; if (!create_hard_link) { create_hard_link = (T) GetProcAddress(