summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-11-22 07:11:42 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2022-11-24 03:45:46 +0100
commit7fe524e1828ec80f1d776711614e5620a42779f8 (patch)
tree754e4c07aae5fd9edc3563a658b521f879552f65 /tests
parenttests: Keep .log files in objdir. (diff)
downloadgnupg2-7fe524e1828ec80f1d776711614e5620a42779f8.tar.xz
gnupg2-7fe524e1828ec80f1d776711614e5620a42779f8.zip
tests:gpgscm:w32: Fix for GetTempPath.
* tests/gpgscm/ffi.c (do_get_temp_path): Remove the last backslash. -- Forward port from 2.2 branch of: 9a75460652d6055983930e80e022396f613ed6f7 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/gpgscm/ffi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c
index aefd7c385..ce18e0794 100644
--- a/tests/gpgscm/ffi.c
+++ b/tests/gpgscm/ffi.c
@@ -357,6 +357,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");