Skip to content

Commit

Permalink
修复一处缓冲区问题.
Browse files Browse the repository at this point in the history
  • Loading branch information
adonais committed Aug 7, 2018
1 parent 3493010 commit a484251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BITS = 64
CFLAGS = $(VFLAGS) /TC /D "WIN64" /D "_WIN64" /favor:blend
CXXFLAGS = $(VFLAGS) /TP /D "WIN64" /D "_WIN64" /favor:blend
ASMFLAGS = -fwin64 -O2 -DWINDOWS -Worphan-labels
!ERROR Doesn't support the project's platform, you can build the libcurl for x64.
!else
PLATFORM = X86
BITS = 32
Expand Down
3 changes: 2 additions & 1 deletion src/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ init_resolver(void)
char url[MAX_PATH + 1];
WCHAR wurl[MAX_PATH + 1];
int res = 1;
if (!GetTempPathW(sizeof(temp_path), temp_path))
if (!GetTempPathW(MAX_PATH, temp_path))
{
return res;
}
Expand All @@ -195,6 +195,7 @@ init_resolver(void)
pfile = CreateFileW(temp_names, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (pfile == INVALID_HANDLE_VALUE)
{
DeleteFileW(temp_names);
printf("CreateFileW temp file return false\n");
return res;
}
Expand Down

0 comments on commit a484251

Please sign in to comment.