#include <lib-lib/mem.h>
#include <lib-lib/str.h>
+#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
#include "mutt.h"
#include "mutt_crypt.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
-#include "ascii.h"
#include "handler.h"
#include "enter.h"
#include "mime.h"
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);
}
}
state_attach_puts (": ", s);
if (t0)
state_attach_puts (t0, s);
- if (t1 && !(t0 && !str_cmp (t0, t1))) {
+ if (t1 && !(t0 && !m_strcmp(t0, t1))) {
if (t0)
state_attach_puts (",", s);
state_attach_puts (t1, s);
b = b->parts->next;
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.fpin = fpin;
mutt_mktemp (tempfile);
if (!(*fpout = safe_fopen (tempfile, "w+"))) {
saved_b_type = b->type;
saved_b_offset = b->offset;
saved_b_length = b->length;
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.fpin = fpin;
fseeko (s.fpin, b->offset, 0);
mutt_mktemp (tempfile);
b->offset = 0;
rewind (tmpfp);
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.fpin = tmpfp;
s.fpout = 0;
mutt_mktemp (tempfile);
saved_b_type = bb->type;
saved_b_offset = bb->offset;
saved_b_length = bb->length;
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.fpin = *fpout;
fseeko (s.fpin, bb->offset, 0);
mutt_mktemp (tempfile);
rewind (tmpfp);
fclose (*fpout);
- memset (&s, 0, sizeof (s));
+ p_clear(&s, 1);
s.fpin = tmpfp;
s.fpout = 0;
mutt_mktemp (tempfile);
while (fgets (buf, sizeof (buf), tfp)) {
if (!str_ncmp ("-----BEGIN PGP ", buf, 15)) {
- if (!str_cmp ("MESSAGE-----\n", buf + 15))
+ if (!m_strcmp("MESSAGE-----\n", buf + 15))
enc = 1;
- else if (!str_cmp ("SIGNED MESSAGE-----\n", buf + 15))
+ else if (!m_strcmp("SIGNED MESSAGE-----\n", buf + 15))
sgn = 1;
}
}
continue;
}
- if (!str_cmp (buf, "-----BEGIN PGP SIGNATURE-----\n"))
+ if (!m_strcmp(buf, "-----BEGIN PGP SIGNATURE-----\n"))
break;
if (armor_header) {
clearsign = 0;
start_pos = last_pos;
- if (!str_cmp ("MESSAGE-----\n", buf + 15))
+ if (!m_strcmp("MESSAGE-----\n", buf + 15))
needpass = 1;
- else if (!str_cmp ("SIGNED MESSAGE-----\n", buf + 15)) {
+ else if (!m_strcmp("SIGNED MESSAGE-----\n", buf + 15)) {
clearsign = 1;
needpass = 0;
}
else if (!option (OPTDONTHANDLEPGPKEYS) &&
- !str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15)) {
+ !m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15)) {
needpass = 0;
pgp_keyblock = 1;
}
gpgme_data_write (armored_data, buf, m_strlen(buf));
- if ((needpass && !str_cmp ("-----END PGP MESSAGE-----\n", buf))
+ if ((needpass && !m_strcmp("-----END PGP MESSAGE-----\n", buf))
|| (!needpass
- && (!str_cmp ("-----END PGP SIGNATURE-----\n", buf)
- || !str_cmp ("-----END PGP PUBLIC KEY BLOCK-----\n",
+ && (!m_strcmp("-----END PGP SIGNATURE-----\n", buf)
+ || !m_strcmp("-----END PGP PUBLIC KEY BLOCK-----\n",
buf))))
break;
}
int any = 0;
for (; dn->key; dn++) {
- if (!str_cmp (dn->key, key)) {
+ if (!m_strcmp(dn->key, key)) {
if (any)
fputs (" + ", fp);
print_utf8 (fp, dn->value, m_strlen(dn->value));
/* now print the rest without any specific ordering */
for (; dn->key; dn++) {
for (i = 0; stdpart[i]; i++) {
- if (!str_cmp (dn->key, stdpart[i]))
+ if (!m_strcmp(dn->key, stdpart[i]))
break;
}
if (!stdpart[i]) {
k = key->kobj;
gpgme_key_ref (k);
- while ((s = k->chain_id) && k->subkeys && str_cmp (s, k->subkeys->fpr)) {
+ while ((s = k->chain_id) && k->subkeys && m_strcmp(s, k->subkeys->fpr)) {
putc ('\n', fp);
err = gpgme_op_keylist_start (listctx, s, 0);
gpgme_key_release (k);
for (t = strtok (scratch, " ,.:\"()<>\n"); t;
t = strtok (NULL, " ,.:\"()<>\n")) {
if (m_strlen(t) > 3)
- hints = mutt_add_list (hints, t);
+ hints = mutt_add_list(hints, t);
}
p_delete(&scratch);