_tempnam and _wtempnam should not create the temp file (reported by

Wim Vanderbauwhede).
This commit is contained in:
Alexandre Julliard 2003-09-27 02:45:39 +00:00
parent 757caa0103
commit 2470af6213
1 changed files with 2 additions and 0 deletions

View File

@ -1412,6 +1412,7 @@ char *_tempnam(const char *dir, const char *prefix)
if (GetTempFileNameA(dir,prefix,0,tmpbuf))
{
TRACE("got name (%s)\n",tmpbuf);
DeleteFileA(tmpbuf);
return _strdup(tmpbuf);
}
TRACE("failed (%ld)\n",GetLastError());
@ -1429,6 +1430,7 @@ MSVCRT_wchar_t *_wtempnam(const MSVCRT_wchar_t *dir, const MSVCRT_wchar_t *prefi
if (GetTempFileNameW(dir,prefix,0,tmpbuf))
{
TRACE("got name (%s)\n",debugstr_w(tmpbuf));
DeleteFileW(tmpbuf);
return _wcsdup(tmpbuf);
}
TRACE("failed (%ld)\n",GetLastError());