Make tmpfile code compile without warnings

svn:r1123
This commit is contained in:
Nick Mathewson 2009-02-13 13:43:35 +00:00
parent 79b7799bd1
commit 73094d5952

View File

@ -95,8 +95,9 @@ regress_make_tmpfile(const void *data, size_t datalen)
{
#ifndef WIN32
char tmpfilename[32];
int fd;
strcpy(tmpfilename, "/tmp/eventtmp.XXXX");
int fd = mkstemp(tmpfilename);
fd = mkstemp(tmpfilename);
if (fd == -1)
return (-1);
if (write(fd, data, datalen) != datalen) {