mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 01:42:27 +00:00
Fix compilation in MinGW
This commit is contained in:
parent
2fcf9c8273
commit
c035ede234
@ -706,7 +706,7 @@ static int read_unmerged(git_index *index, const char *buffer, size_t size)
|
|||||||
long tmp;
|
long tmp;
|
||||||
|
|
||||||
if (git__strtol32(&tmp, buffer, &endptr, 8) < GIT_SUCCESS ||
|
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;
|
return GIT_ERROR;
|
||||||
|
|
||||||
lost->mode[i] = tmp;
|
lost->mode[i] = tmp;
|
||||||
|
@ -236,16 +236,13 @@ extern int p_creat(const char *path, int mode);
|
|||||||
|
|
||||||
int p_mkstemp(char *tmp_path)
|
int p_mkstemp(char *tmp_path)
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
r = _mktemp_s(tmp_path, GIT_PATH_MAX);
|
if (_mktemp_s(tmp_path, GIT_PATH_MAX) != 0)
|
||||||
#else
|
|
||||||
r = _mktemp(tmp_path);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (r != 0)
|
|
||||||
return GIT_EOSERR;
|
return GIT_EOSERR;
|
||||||
|
#else
|
||||||
|
if (_mktemp(tmp_path) == NULL)
|
||||||
|
return GIT_EOSERR;
|
||||||
|
#endif
|
||||||
|
|
||||||
return p_creat(tmp_path, 0744);
|
return p_creat(tmp_path, 0744);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user