projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add more encoding arrays
[apps/madmutt.git]
/
smime.c
diff --git
a/smime.c
b/smime.c
index
6a2486d
..
092c1bd
100644
(file)
--- a/
smime.c
+++ b/
smime.c
@@
-18,13
+18,13
@@
#include <lib-lib/macros.h>
#include <lib-lib/file.h>
#include <lib-lib/macros.h>
#include <lib-lib/file.h>
+#include <lib-mime/mime.h>
+
#include "mutt.h"
#include "enter.h"
#include "handler.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mutt.h"
#include "enter.h"
#include "handler.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
-#include "smime.h"
-#include "mime.h"
#include "copy.h"
#include "lib/debug.h"
#include "copy.h"
#include "lib/debug.h"
@@
-83,10
+83,19
@@
static char SmimeIntermediateToUse[_POSIX_PATH_MAX];
/*
/*
- * Queries and passphrase handling.
+ * Create a format string to be used with scanf.
+ * To use it, write, for instance, MUTT_FORMAT(HUGE_STRING).
+ *
+ * See K&R 2nd ed, p. 231 for an explanation.
*/
*/
+#define _MUTT_FORMAT_2(a,b) "%" a b
+#define _MUTT_FORMAT_1(a, b) _MUTT_FORMAT_2(#a, b)
+#define MUTT_FORMAT(a) _MUTT_FORMAT_1(a, "s")
+/*
+ * Queries and passphrase handling.
+ */
/* these are copies from pgp.c */
/* these are copies from pgp.c */
@@
-148,7
+157,7
@@
static const char *_mutt_fmt_smime_command (char *dest,
char buf1[LONG_STRING], buf2[LONG_STRING];
struct stat sb;
char buf1[LONG_STRING], buf2[LONG_STRING];
struct stat sb;
-
strfcpy (path, NONULL (SmimeCALocation), sizeof (path
));
+
m_strcpy(path, sizeof(path), NONULL(SmimeCALocation
));
mutt_expand_path (path, sizeof (path));
mutt_quote_filename (buf1, sizeof (buf1), path);
mutt_expand_path (path, sizeof (path));
mutt_quote_filename (buf1, sizeof (buf1), path);
@@
-553,7
+562,7
@@
char *smime_get_field_from_db (char *mailbox, char *query, short public,
continue;
}
else if (choice == M_YES) {
continue;
}
else if (choice == M_YES) {
-
strfcpy (key, fields[1], sizeof (key)
);
+
m_strcpy(key, sizeof(key), fields[1]
);
ask = 0;
break;
}
ask = 0;
break;
}
@@
-561,7
+570,7
@@
char *smime_get_field_from_db (char *mailbox, char *query, short public,
else {
if (public)
key_trust_level = *fields[4];
else {
if (public)
key_trust_level = *fields[4];
-
strfcpy (key, fields[1], sizeof (key)
);
+
m_strcpy(key, sizeof(key), fields[1]
);
}
found = 1;
}
}
found = 1;
}
@@
-577,13
+586,13
@@
char *smime_get_field_from_db (char *mailbox, char *query, short public,
if (numFields >= 3 &&
!(m_strncasecmp(query, fields[2], query_len))) {
ask = 0;
if (numFields >= 3 &&
!(m_strncasecmp(query, fields[2], query_len))) {
ask = 0;
-
strfcpy (key, fields[1], sizeof (key)
);
+
m_strcpy(key, sizeof(key), fields[1]
);
}
/* query = certificate: return intermediate certificate. */
else if (numFields >= 4 &&
!(m_strncasecmp(query, fields[1], query_len))) {
ask = 0;
}
/* query = certificate: return intermediate certificate. */
else if (numFields >= 4 &&
!(m_strncasecmp(query, fields[1], query_len))) {
ask = 0;
-
strfcpy (key, fields[3], sizeof (key)
);
+
m_strcpy(key, sizeof(key), fields[3]
);
}
}
}
}