diff options
Diffstat (limited to 'camel/camel-pgp-context.c')
-rw-r--r-- | camel/camel-pgp-context.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/camel/camel-pgp-context.c b/camel/camel-pgp-context.c index 292279b229..d92fa93cae 100644 --- a/camel/camel-pgp-context.c +++ b/camel/camel-pgp-context.c @@ -998,15 +998,21 @@ pgp_verify (CamelCipherContext *ctx, CamelCipherHash hash, CamelStream *istream, cd = iconv_open ("UTF-8", locale); if (cd != (iconv_t) -1) { const char *inbuf; + int ret; inbuf = diagnostics; - iconv (cd, &inbuf, &inlen, &outbuf, &outlen); + ret = iconv (cd, &inbuf, &inlen, &outbuf, &outlen); + if (ret >= 0) { + iconv (cd, NULL, 0, &outbuf, &outlen); + } iconv_close (cd); *outbuf = '\0'; } else { const char *inptr, *inend; + g_warning ("CamelPgpContext::pgp_verify: cannot convert from %s to UTF-8", locale); + inptr = diagnostics; inend = inptr + inlen; |