# include "config.h"
#endif
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-
-#include <lib-mime/mime.h>
-
-#include <lib-ui/curses.h>
-#include <lib-ui/enter.h>
-#include <lib-ui/menu.h>
-
-#include "mutt.h"
-#include "handler.h"
-#include "copy.h"
-
-#include "lib/debug.h"
-
#include <sys/wait.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#ifdef HAVE_LOCALE_H
-#include <locale.h>
+# include <locale.h>
#endif
-
#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
+# include <sys/time.h>
#endif
-
#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
+# include <sys/resource.h>
#endif
+#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
+
+#include <lib-mime/mime.h>
+
+#include <lib-ui/curses.h>
+#include <lib-ui/enter.h>
+#include <lib-ui/menu.h>
+
+#include "mutt.h"
+#include "alias.h"
+#include "handler.h"
+#include "copy.h"
+#include "alias.h"
#include "crypt.h"
struct smime_command_context {
/* This is almost identical to ppgp's invoking interface. */
-static const char *_mutt_fmt_smime_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_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)
{
char fmt[16];
struct smime_command_context *cctx = (struct smime_command_context *) data;
-static void mutt_smime_command (char *d, size_t dlen,
+static void mutt_smime_command (char *d, ssize_t dlen,
struct smime_command_context *cctx,
const char *fmt)
{
mutt_FormatString (d, dlen, NONULL (fmt), _mutt_fmt_smime_command,
(unsigned long) cctx, 0);
- debug_print (2, ("%s\n", d));
}
static pid_t smime_invoke (FILE ** smimein, FILE ** smimeout,
return certificate file name.
*/
-static void smime_entry (char *s, size_t l, MUTTMENU * menu, int num)
+static void smime_entry (char *s, ssize_t l, MUTTMENU * menu, int num)
{
smime_id *Table = (smime_id *) menu->data;
smime_id this = Table[num];
-char *smime_ask_for_key (char *prompt, char *mailbox, short public)
+char *smime_ask_for_key (char *prompt, char *mailbox __attribute__((unused)),
+ short public)
{
char *fname;
smime_id *Table;
long cert_num; /* Will contain the number of certificates.
* To be able to get it, the .index file will be read twice... */
char index_file[_POSIX_PATH_MAX];
- FILE *index;
+ FILE *idx;
char buf[LONG_STRING];
char fields[5][STRING];
int numFields, hash_suffix, done, cur; /* The current entry */
snprintf (index_file, sizeof (index_file), "%s/.index",
public ? NONULL (SmimeCertificates) : NONULL (SmimeKeys));
- index = fopen (index_file, "r");
- if (index == NULL) {
+ idx = fopen (index_file, "r");
+ if (idx == NULL) {
mutt_perror (index_file);
return NULL;
}
/* Count Lines */
cert_num = 0;
- while (!feof (index)) {
- if (fgets (buf, sizeof (buf), index))
+ while (!feof (idx)) {
+ if (fgets (buf, sizeof (buf), idx))
cert_num++;
}
- fclose (index);
+ fclose (idx);
for (;;) {
*qry = 0;
_("S/MIME certificates matching \"%s\"."), qry);
- index = fopen (index_file, "r");
- if (index == NULL) {
+ idx = fopen (index_file, "r");
+ if (idx == NULL) {
mutt_perror (index_file);
return NULL;
}
/* Read Entries */
cur = 0;
Table = p_new(smime_id, cert_num);
- while (!feof (index)) {
+ while (!feof (idx)) {
numFields =
- fscanf (index, MUTT_FORMAT (STRING) " %x.%i " MUTT_FORMAT (STRING),
+ fscanf (idx, MUTT_FORMAT (STRING) " %x.%i " MUTT_FORMAT (STRING),
fields[0], &hash, &hash_suffix, fields[2]);
if (public)
- fscanf (index, MUTT_FORMAT (STRING) " " MUTT_FORMAT (STRING) "\n",
+ fscanf (idx, MUTT_FORMAT (STRING) " " MUTT_FORMAT (STRING) "\n",
fields[3], fields[4]);
/* 0=email 1=name 2=nick 3=intermediate 4=trust */
cur++;
}
- fclose (index);
+ fclose (idx);
/* Make Helpstring */
helpstr[0] = 0;
}
if (!found && (t = mutt_default_from ())) {
_smime_getkeys (t->mailbox);
- address_delete (&t);
+ address_list_wipe(&t);
}
}
char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc)
{
char *keyID, *keylist = NULL;
- size_t keylist_size = 0;
- size_t keylist_used = 0;
+ ssize_t keylist_size = 0;
+ ssize_t keylist_used = 0;
address_t *tmp = NULL, *addr = NULL;
address_t **last = &tmp;
address_t *p, *q;
if (!keyID) {
mutt_message (_("No (valid) certificate found for %s."), q->mailbox);
p_delete(&keylist);
- address_delete (&tmp);
- address_delete (&addr);
+ address_list_wipe(&tmp);
+ address_list_wipe(&addr);
return NULL;
}
sprintf (keylist + keylist_used, "%s\n", keyID); /* __SPRINTF_CHECKED__ */
keylist_used = m_strlen(keylist);
- address_delete (&addr);
+ address_list_wipe(&addr);
}
- address_delete (&tmp);
+ address_list_wipe(&tmp);
return (keylist);
}
/* Add a certificate and update index file (externally). */
-void smime_invoke_import (char *infile, char *mailbox)
+void smime_invoke_import (char *infile, char *mailbox __attribute__ ((unused)))
{
char tmpfname[_POSIX_PATH_MAX], *certfile = NULL, buf[STRING];
FILE *smimein = NULL, *fpout = NULL, *fperr = NULL;
int badsig = -1;
long tmpoffset = 0;
- size_t tmplength = 0;
+ ssize_t tmplength = 0;
int origType = sigbdy->type;
char *savePrefix = NULL;
else {
char *line = NULL;
int lineno = 0;
- size_t linelen;
+ ssize_t linelen;
fflush (smimeerr);
rewind (smimeerr);
if (type & SIGNOPAQUE) {
char *line = NULL;
int lineno = 0;
- size_t linelen;
+ ssize_t linelen;
rewind (smimeerr);
char tempfile[_POSIX_PATH_MAX];
STATE s;
long tmpoffset = b->offset;
- size_t tmplength = b->length;
+ ssize_t tmplength = b->length;
int origType = b->type;
FILE *tmpfp = NULL;
int rv = 0;