Fix Windows build failure when libunbound is present.

This commit is contained in:
Jim Hague 2019-10-29 17:42:21 +00:00
parent b0ef0887db
commit ea09baf376
1 changed files with 9 additions and 1 deletions

View File

@ -2395,7 +2395,15 @@ getdns_context_set_dns_root_servers(
{
#ifdef HAVE_LIBUNBOUND
# ifndef HAVE_UB_CTX_SET_STUB
char tmpfn[FILENAME_MAX] = P_tmpdir "/getdns-root-dns-servers-XXXXXX";
char tmpfn[FILENAME_MAX];
# ifdef USE_WINSOCK
GetTempPathA(FILENAME_MAX, tmpfn);
strncat_s(tmpfn, FILENAME_MAX, "/getdns-root-dns-servers-XXXXXX", _TRUNCATE);
# else
strlcpy(tmpfn, P_tmpdir "/getdns-root-dns-servers-XXXXXX", FILENAME_MAX);
# endif
FILE *fh;
int fd;
size_t dst_len;