msvcrt: Fixed tmpnam and _wtmpname implementation.
This commit is contained in:
parent
9fc0377f64
commit
5e9ee3b909
|
@ -3683,6 +3683,7 @@ char * CDECL MSVCRT_tmpnam(char *s)
|
|||
{
|
||||
size = msvcrt_int_to_base32(tmpnam_unique++, tmpstr);
|
||||
memcpy(p, tmpstr, size);
|
||||
p[size] = '\0';
|
||||
if (GetFileAttributesA(s) == INVALID_FILE_ATTRIBUTES &&
|
||||
GetLastError() == ERROR_FILE_NOT_FOUND)
|
||||
break;
|
||||
|
@ -3714,6 +3715,7 @@ MSVCRT_wchar_t * CDECL MSVCRT_wtmpnam(MSVCRT_wchar_t *s)
|
|||
{
|
||||
size = msvcrt_int_to_base32_w(tmpnam_unique++, tmpstr);
|
||||
memcpy(p, tmpstr, size*sizeof(MSVCRT_wchar_t));
|
||||
p[size] = '\0';
|
||||
if (GetFileAttributesW(s) == INVALID_FILE_ATTRIBUTES &&
|
||||
GetLastError() == ERROR_FILE_NOT_FOUND)
|
||||
break;
|
||||
|
|
|
@ -74,6 +74,8 @@ static inline void msvcrt_free_tls_mem(void)
|
|||
HeapFree(GetProcessHeap(),0,tls->strerror_buffer);
|
||||
HeapFree(GetProcessHeap(),0,tls->wcserror_buffer);
|
||||
HeapFree(GetProcessHeap(),0,tls->time_buffer);
|
||||
HeapFree(GetProcessHeap(),0,tls->tmpnam_buffer);
|
||||
HeapFree(GetProcessHeap(),0,tls->wtmpnam_buffer);
|
||||
if(tls->have_locale) {
|
||||
free_locinfo(tls->locinfo);
|
||||
free_mbcinfo(tls->mbcinfo);
|
||||
|
|
Loading…
Reference in New Issue