posix_w32: prevent segfaulting on Windows when building a temporary filename

This commit is contained in:
nulltoken 2011-12-14 20:00:34 +01:00
parent 16a9f32abd
commit 489c36663e

View File

@ -365,7 +365,7 @@ extern int p_creat(const char *path, mode_t mode);
int p_mkstemp(char *tmp_path)
{
#if defined(_MSC_VER)
if (_mktemp_s(tmp_path, GIT_PATH_MAX) != 0)
if (_mktemp_s(tmp_path, strlen(tmp_path) + 1) != 0)
return GIT_EOSERR;
#else
if (_mktemp(tmp_path) == NULL)