less horrible strncpy's
[apps/madmutt.git] / crypt-gpgme.c
index 9728bcc..d01792b 100644 (file)
@@ -687,8 +687,7 @@ static int get_micalg (gpgme_ctx_t ctx, char *buf, size_t buflen)
   if (result) {
     algorithm_name = gpgme_hash_algo_name (result->signatures->hash_algo);
     if (algorithm_name) {
-      strncpy (buf, algorithm_name, buflen - 1);
-      buf[buflen - 1] = 0;
+      m_strcpy(buf, buflen, algorithm_name);
     }
   }