more cosmetics.
[apps/madmutt.git] / lib-crypt / pgpinvoke.c
index 0314412..551024a 100644 (file)
  * is almost entirely format based.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
+#include <lib-sys/unix.h>
 #include <lib-mime/mime.h>
-
 #include <lib-ui/curses.h>
 
-#include "mutt.h"
 #include "mutt_idna.h"
 #include "pgp.h"
 
-#include "lib/debug.h"
 
 /*
  * The actual command line formatter.
@@ -53,14 +34,11 @@ struct pgp_command_context {
 };
 
 
-const char *_mutt_fmt_pgp_command (char *dest,
-                                   size_t destlen,
-                                   char op,
-                                   const char *src,
-                                   const char *prefix,
-                                   const char *ifstring,
-                                   const char *elsestring,
-                                   unsigned long data, format_flag flags)
+static const char *
+_mutt_fmt_pgp_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)
 {
   char fmt[16];
   struct pgp_command_context *cctx = (struct pgp_command_context *) data;
@@ -139,12 +117,12 @@ const char *_mutt_fmt_pgp_command (char *dest,
   return (src);
 }
 
-void mutt_pgp_command (char *d, size_t dlen, struct pgp_command_context *cctx,
-                       const char *fmt)
+static void
+mutt_pgp_command(char *d, ssize_t dlen, struct pgp_command_context *cctx,
+                 const char *fmt)
 {
   mutt_FormatString (d, dlen, NONULL (fmt), _mutt_fmt_pgp_command,
                      (unsigned long) cctx, 0);
-  debug_print (2, ("%s\n", d));
 }
 
 /*
@@ -285,10 +263,9 @@ void pgp_invoke_getkeys (address_t * addr)
   personal = addr->personal;
   addr->personal = NULL;
 
-  *tmp = '\0';
-  mutt_addrlist_to_local (addr);
-  rfc822_write_address_single (tmp, sizeof (tmp), addr, 0);
-  mutt_quote_filename (buff, sizeof (buff), tmp);
+  mutt_addrlist_to_local(addr);
+  rfc822_addrcpy(tmp, sizeof(tmp), addr, 0);
+  mutt_quote_filename(buff, sizeof(buff), tmp);
 
   addr->personal = personal;
 
@@ -327,7 +304,7 @@ pid_t pgp_invoke_verify_key (FILE ** pgpin, FILE ** pgpout, FILE ** pgperr,
 
 pid_t pgp_invoke_list_keys (FILE ** pgpin, FILE ** pgpout, FILE ** pgperr,
                             int pgpinfd, int pgpoutfd, int pgperrfd,
-                            pgp_ring_t keyring, LIST * hints)
+                            pgp_ring_t keyring, string_list_t * hints)
 {
   char uids[HUGE_STRING];
   char tmpuids[HUGE_STRING];
@@ -338,7 +315,7 @@ pid_t pgp_invoke_list_keys (FILE ** pgpin, FILE ** pgpout, FILE ** pgperr,
   for (; hints; hints = hints->next) {
     mutt_quote_filename (quoted, sizeof (quoted), (char *) hints->data);
     snprintf (tmpuids, sizeof (tmpuids), "%s %s", uids, quoted);
-    strcpy (uids, tmpuids);     /* __STRCPY_CHECKED__ */
+    m_strcpy(uids, sizeof(uids), tmpuids);
   }
 
   return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,