Robert Wilhelm : scrrun: Generate temp name with tmp suffix.

Alexandre Julliard julliard at winehq.org
Tue Jan 25 15:41:17 CST 2022


Module: wine
Branch: master
Commit: f4d40a7379133e355004c731e2a397e888196db1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f4d40a7379133e355004c731e2a397e888196db1

Author: Robert Wilhelm <robert.wilhelm at gmx.net>
Date:   Mon Jan 24 21:41:20 2022 +0100

scrrun: Generate temp name with tmp suffix.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52163
Signed-off-by: Robert Wilhelm <robert.wilhelm at gmx.net>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/scrrun/filesystem.c       | 4 ++--
 dlls/scrrun/tests/filesystem.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 7b0b2e110a6..5d7d42850ab 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3318,12 +3318,12 @@ static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *result)
     if (!result)
         return E_POINTER;
 
-    if (!(*result = SysAllocStringLen(NULL, 12)))
+    if (!(*result = SysAllocStringLen(NULL, 13)))
         return E_OUTOFMEMORY;
 
     if(!RtlGenRandom(&random, sizeof(random)))
         return E_FAIL;
-    swprintf(*result, 12, L"rad%05X.txt", random & 0xfffff);
+    swprintf(*result, 13, L"rad%05X.tmp", random & 0xfffff);
     return S_OK;
 }
 
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 1886c52d009..da1ca316382 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -482,7 +482,7 @@ static void test_GetTempName(void)
     result = (BSTR)0xdeadbeef;
     hr = IFileSystem3_GetTempName(fs3, &result);
     ok(hr == S_OK, "GetTempName returned %x, expected S_OK\n", hr);
-    todo_wine ok(!!wcsstr( result,L".tmp"), "GetTempName returned %s, expected .tmp suffix\n", debugstr_w(result));
+    ok(!!wcsstr( result,L".tmp"), "GetTempName returned %s, expected .tmp suffix\n", debugstr_w(result));
     SysFreeString(result);
 }
 




More information about the wine-cvs mailing list