From: Marcus Brinkmann Date: Thu, 29 Aug 2002 00:30:31 +0000 (+0000) Subject: 2002-08-29 Marcus Brinkmann X-Git-Tag: gpgme-0-3-10~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f01df1076053a92c241f6ae98375bbb7bfe3d8ee;p=gpgme.git 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 . --- diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index bef845b..e64a7fa 100644 --- a/gpgme/ChangeLog +++ b/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/gpgme/passphrase.c b/gpgme/passphrase.c index 52d75ca..b3c89b8 100644 --- a/gpgme/passphrase.c +++ b/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/gpgme/vasprintf.c b/gpgme/vasprintf.c index 30b5e83..6b35e43 100644 --- a/gpgme/vasprintf.c +++ b/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') {