From 4ea7f03c1013f886e51c7740a06afaa9060dada7 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 22 Nov 2022 15:11:42 +0900 Subject: [PATCH] tests:gpgscm:w32: Fix for GetTempPath. * tests/gpgscm/ffi.c (do_get_temp_path): Remove the last backslash. -- Signed-off-by: NIIBE Yutaka --- tests/gpgscm/ffi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c index dde5b5282..355021cd3 100644 --- a/tests/gpgscm/ffi.c +++ b/tests/gpgscm/ffi.c @@ -353,6 +353,11 @@ do_get_temp_path (scheme *sc, pointer args) #ifdef HAVE_W32_SYSTEM if (GetTempPath (MAX_PATH+1, buffer) == 0) FFI_RETURN_STRING (sc, "/temp"); + else + { + size_t len = strlen (buffer); + buffer[len-1] = 0; + } FFI_RETURN_STRING (sc, buffer); #else FFI_RETURN_STRING (sc, "/tmp");