Signed-off-by: Pierre Habouzit <madcoder@debian.org>
static int get_micalg(gpgme_ctx_t ctx, char *buf, ssize_t buflen)
{
gpgme_sign_result_t result = NULL;
static int get_micalg(gpgme_ctx_t ctx, char *buf, ssize_t buflen)
{
gpgme_sign_result_t result = NULL;
- const char *algorithm_name = NULL;
+ const char *alg = NULL;
result = gpgme_op_sign_result(ctx);
result = gpgme_op_sign_result(ctx);
- if (result) {
- algorithm_name = gpgme_hash_algo_name (result->signatures->hash_algo);
- if (algorithm_name) {
- m_strcpy(buf, buflen, algorithm_name);
- }
+ if (result && result->signatures) {
+ alg = gpgme_hash_algo_name(result->signatures->hash_algo);
+ m_strcpy(buf, buflen, NONULL(alg));
}
static void print_time(time_t t, STATE *s)
}
static void print_time(time_t t, STATE *s)