X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-crypt%2Fsmime.c;h=7e5690d09f9a0f63bd3a32693335e70b257a5654;hp=bbaa198173099b8669dd4d0cce8eb2545de9086c;hb=9468c36e7656e50a91f759e3f5498b7f86dbec30;hpb=3242c00b2d3f7f1c1554bcebfb8a390fddea095f diff --git a/lib-crypt/smime.c b/lib-crypt/smime.c index bbaa198..7e5690d 100644 --- a/lib-crypt/smime.c +++ b/lib-crypt/smime.c @@ -113,13 +113,13 @@ int smime_valid_passphrase (void) /* This is almost identical to ppgp's invoking interface. */ static const char * -_mutt_fmt_smime_command (char *dest, ssize_t destlen, char op, - const char *src, const char *prefix, - const char *ifstring, const char *elsestring, - unsigned long data, format_flag flags) +_mutt_fmt_smime_command (char *dest, ssize_t destlen, + char op, const char *src, const char *prefix, + const char *ifstr, const char *elstr, + anytype data, format_flag flags) { char fmt[16]; - struct smime_command_context *cctx = (struct smime_command_context *) data; + struct smime_command_context *cctx = data.ptr; int optional = (flags & M_FORMAT_OPTIONAL); switch (op) { @@ -218,12 +218,11 @@ _mutt_fmt_smime_command (char *dest, ssize_t destlen, char op, break; } - if (optional) - m_strformat(dest, destlen, ifstring, _mutt_fmt_smime_command, data, 0); - else if (flags & M_FORMAT_OPTIONAL) - m_strformat(dest, destlen, elsestring, _mutt_fmt_smime_command, data, 0); + if (flags & M_FORMAT_OPTIONAL) + m_strformat(dest, destlen, 0, optional ? ifstr : elstr, + _mutt_fmt_smime_command, data, 0); - return (src); + return src; } @@ -232,8 +231,7 @@ static void mutt_smime_command (char *d, ssize_t dlen, struct smime_command_context *cctx, const char *fmt) { - m_strformat(d, dlen, NONULL (fmt), _mutt_fmt_smime_command, - (unsigned long)cctx, 0); + m_strformat(d, dlen, 0, fmt, _mutt_fmt_smime_command, cctx, 0); } static pid_t smime_invoke (FILE ** smimein, FILE ** smimeout,