projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
less horrible strncpy's
[apps/madmutt.git]
/
pgpkey.c
diff --git
a/pgpkey.c
b/pgpkey.c
index
009955d
..
d995bc8
100644
(file)
--- a/
pgpkey.c
+++ b/
pgpkey.c
@@
-13,11
+13,13
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
#include "mutt.h"
#include "enter.h"
#include "mutt.h"
#include "enter.h"
-#include "ascii.h"
#include "recvattach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "recvattach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
@@
-26,7
+28,6
@@
#include "pager.h"
#include "sort.h"
#include "pager.h"
#include "sort.h"
-#include "lib/str.h"
#include "lib/debug.h"
#include <string.h>
#include "lib/debug.h"
#include <string.h>
@@
-653,7
+654,7
@@
pgp_key_t pgp_ask_for_key (char *tag, char *whatfor,
}
}
-
FOREVER
{
+
for (;;)
{
resp[0] = 0;
if (mutt_get_field (tag, resp, sizeof (resp), M_CLEAR) != 0)
return NULL;
resp[0] = 0;
if (mutt_get_field (tag, resp, sizeof (resp), M_CLEAR) != 0)
return NULL;
@@
-665,8
+666,8
@@
pgp_key_t pgp_ask_for_key (char *tag, char *whatfor,
l = p_new(struct pgp_cache, 1);
l->next = id_defaults;
id_defaults = l;
l = p_new(struct pgp_cache, 1);
l->next = id_defaults;
id_defaults = l;
- l->what =
str_dup
(whatfor);
- l->dflt =
str_dup
(resp);
+ l->what =
m_strdup
(whatfor);
+ l->dflt =
m_strdup
(resp);
}
}
}
}
@@
-742,13
+743,13
@@
BODY *pgp_make_key_attachment (char *tempf)
fclose (devnull);
att = mutt_new_body ();
fclose (devnull);
att = mutt_new_body ();
- att->filename =
str_dup
(tempf);
+ att->filename =
m_strdup
(tempf);
att->unlink = 1;
att->use_disp = 0;
att->type = TYPEAPPLICATION;
att->unlink = 1;
att->use_disp = 0;
att->type = TYPEAPPLICATION;
- att->subtype =
str_dup
("pgp-keys");
+ att->subtype =
m_strdup
("pgp-keys");
snprintf (buff, sizeof (buff), _("PGP Key %s."), tmp);
snprintf (buff, sizeof (buff), _("PGP Key %s."), tmp);
- att->description =
str_dup
(buff);
+ att->description =
m_strdup
(buff);
mutt_update_encoding (att);
stat (tempf, &sb);
mutt_update_encoding (att);
stat (tempf, &sb);
@@
-762,12
+763,12
@@
static LIST *pgp_add_string_to_hints (LIST * hints, const char *str)
char *scratch;
char *t;
char *scratch;
char *t;
- if ((scratch =
str_dup
(str)) == NULL)
+ if ((scratch =
m_strdup
(str)) == NULL)
return hints;
for (t = strtok (scratch, " ,.:\"()<>\n"); t;
t = strtok (NULL, " ,.:\"()<>\n")) {
return hints;
for (t = strtok (scratch, " ,.:\"()<>\n"); t;
t = strtok (NULL, " ,.:\"()<>\n")) {
- if (
str_len
(t) > 3)
+ if (
m_strlen
(t) > 3)
hints = mutt_add_list (hints, t);
}
hints = mutt_add_list (hints, t);
}