From 412e183e55c5b8b4aab30ec9a144c8c4c69d41c8 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 6 Sep 2024 10:46:36 +0900 Subject: [PATCH] scd:w32: Fix for setting an environment block with GNUPGHOME. * scd/app.c (report_change): It's ASCII or multi-byte encoded string. It's gpgrt's spawn function which converts it to wide char string internally if needed. -- Signed-off-by: NIIBE Yutaka --- scd/app.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scd/app.c b/scd/app.c index ebba472c2..525950e99 100644 --- a/scd/app.c +++ b/scd/app.c @@ -2483,9 +2483,8 @@ report_change (int slot, int old_status, int cur_status) homestr = make_filename (gnupg_homedir (), NULL); #ifdef HAVE_W32_SYSTEM - /* An environment block is terminated by two/four zero bytes. It's - * four zero bytes for Unicode. Let us always use four zero bytes. */ - if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s%c%c%c", homestr, 0, 0, 0) < 0) + /* An environment block is terminated by two zero bytes. */ + if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s%c", homestr, 0) < 0) #else if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s", homestr) < 0) #endif