X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=smime.c;h=608d53b55ac0e6834ddf2bc0647c0695493fca17;hb=d9960a434f5c00a534a0dabe02ae5ab8d4881569;hp=554f02e29a0b19d684953e56cf059f99633ef386;hpb=7f7a0be369840b290248e5b0302beb447fa1b3cd;p=apps%2Fmadmutt.git diff --git a/smime.c b/smime.c index 554f02e..608d53b 100644 --- a/smime.c +++ b/smime.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "mutt.h" #include "enter.h" @@ -93,7 +94,7 @@ static char SmimeIntermediateToUse[_POSIX_PATH_MAX]; void smime_void_passphrase (void) { - memset (SmimePass, 0, sizeof (SmimePass)); + p_clear(SmimePass, sizeof(SmimePass)); SmimeExptime = 0; } @@ -266,7 +267,7 @@ static pid_t smime_invoke (FILE ** smimein, FILE ** smimeout, struct smime_command_context cctx; char cmd[HUGE_STRING]; - memset (&cctx, 0, sizeof (cctx)); + p_clear(&cctx, 1); if (!format || !*format) return (pid_t) - 1; @@ -375,7 +376,7 @@ char *smime_ask_for_key (char *prompt, char *mailbox, short public) } fclose (index); - FOREVER { + for (;;) { *qry = 0; if (mutt_get_field (prompt, qry, sizeof (qry), 0)) return NULL; @@ -409,8 +410,8 @@ char *smime_ask_for_key (char *prompt, char *mailbox, short public) Table[cur].hash = hash; Table[cur].suffix = hash_suffix; - strncpy (Table[cur].email, fields[0], sizeof (Table[cur].email)); - strncpy (Table[cur].nick, fields[2], sizeof (Table[cur].nick)); + m_strcpy(Table[cur].email, sizeof(Table[cur].email), fields[0]); + m_strcpy(Table[cur].nick, sizeof(Table[cur].nick), fields[2]); Table[cur].trust = *fields[4]; Table[cur].public = public; @@ -1813,7 +1814,7 @@ int smime_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur) if (b->parts) return -1; - memset (&s, 0, sizeof (s)); + p_clear(&s, 1); s.fpin = fpin; fseeko (s.fpin, b->offset, 0);