From 92c15bf4e289e0ead67103b2bd76f65bd4a02813 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 29 Aug 2002 00:30:31 +0000 Subject: [PATCH] 2002-08-29 Marcus Brinkmann * passphrase.c (_gpgme_passphrase_status_handler): Reset CTX->result.passphrase->no_passphrase if passphrase is given (good or bad). Submitted by Jean DIRAISON . --- trunk/gpgme/ChangeLog | 6 ++++++ trunk/gpgme/passphrase.c | 2 ++ trunk/gpgme/vasprintf.c | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index bef845b..e64a7fa 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2002-08-29 Marcus Brinkmann + + * passphrase.c (_gpgme_passphrase_status_handler): Reset + CTX->result.passphrase->no_passphrase if passphrase is given (good + or bad). Submitted by Jean DIRAISON . + 2002-08-28 Marcus Brinkmann * posix-io.c (_gpgme_io_spawn): Use a double-fork approach. diff --git a/trunk/gpgme/passphrase.c b/trunk/gpgme/passphrase.c index 52d75ca..b3c89b8 100644 --- a/trunk/gpgme/passphrase.c +++ b/trunk/gpgme/passphrase.c @@ -68,10 +68,12 @@ _gpgme_passphrase_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args case GPGME_STATUS_BAD_PASSPHRASE: ctx->result.passphrase->bad_passphrase++; + ctx->result.passphrase->no_passphrase = 0; break; case GPGME_STATUS_GOOD_PASSPHRASE: ctx->result.passphrase->bad_passphrase = 0; + ctx->result.passphrase->no_passphrase = 0; break; case GPGME_STATUS_NEED_PASSPHRASE: diff --git a/trunk/gpgme/vasprintf.c b/trunk/gpgme/vasprintf.c index 30b5e83..6b35e43 100644 --- a/trunk/gpgme/vasprintf.c +++ b/trunk/gpgme/vasprintf.c @@ -26,6 +26,19 @@ Boston, MA 02111-1307, USA. */ #include #include + +#ifndef va_copy +#if defined (__GNUC__) && defined (__PPC__) \ + && (defined (_CALL_SYSV) || defined (_WIN32)) +#define va_copy(d, s) (*(d) = *(s)) +#elif defined (MUST_COPY_VA_BYVAL) +#define va_copy(d, s) ((d) = (s)) +#else +#define va_copy(d, s) memcpy ((d), (s), sizeof (va_list)) +#endif +#endif + + #ifdef TEST int global_total_width; #endif @@ -44,8 +57,7 @@ int_vasprintf (result, format, args) int total_width = strlen (format) + 1; va_list ap; - /* FIXME: use va_copy() */ - memcpy (&ap, args, sizeof (va_list)); + va_copy (ap, *args); while (*p != '\0') { -- 2.26.2