projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exit strfcpy, only use m_strcpy.
[apps/madmutt.git]
/
imap
/
imap.c
diff --git
a/imap/imap.c
b/imap/imap.c
index
03ef513
..
cb100ce
100644
(file)
--- a/
imap/imap.c
+++ b/
imap/imap.c
@@
-16,11
+16,11
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/str.h>
+#include <lib-lib/buffer.h>
#include "mutt.h"
#include "mutt.h"
-#include "ascii.h"
-#include "buffer.h"
#include "mx.h"
#include "globals.h"
#include "sort.h"
#include "mx.h"
#include "globals.h"
#include "sort.h"
@@
-785,12
+785,13
@@
int imap_close_connection (CONTEXT *ctx)
/* imap_set_flag: append str to flags if we currently have permission
* according to aclbit */
/* imap_set_flag: append str to flags if we currently have permission
* according to aclbit */
-static void imap_set_flag
(IMAP_DATA *
idata, int aclbit, int flag,
-
const char *str, char *flags, size_t flsize)
+static void imap_set_flag
(IMAP_DATA *
idata, int aclbit, int flag,
+ const char *str, char *flags, size_t flsize)
{
{
- if (mutt_bit_isset (idata->rights, aclbit))
- if (flag)
- str_cat (flags, flsize, str);
+ if (mutt_bit_isset(idata->rights, aclbit)) {
+ if (flag)
+ m_strcat(flags, flsize, str);
+ }
}
/* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of
}
/* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of
@@
-975,7
+976,7
@@
int imap_sync_mailbox (CONTEXT * ctx, int expunge, int *index_hint)
if ((rc = imap_check_mailbox (ctx, index_hint, 0)) != 0)
return rc;
if ((rc = imap_check_mailbox (ctx, index_hint, 0)) != 0)
return rc;
-
memset (&cmd, 0, sizeof (cmd)
);
+
p_clear(&cmd, 1
);
/* if we are expunging anyway, we can do deleted messages very quickly... */
if (expunge && mutt_bit_isset (idata->rights, ACL_DELETE)) {
/* if we are expunging anyway, we can do deleted messages very quickly... */
if (expunge && mutt_bit_isset (idata->rights, ACL_DELETE)) {
@@
-1175,16
+1176,16
@@
int imap_mailbox_check (char *path, int new)
p_delete(&mx.mbox);
imap_munge_mbox_name (mbox, sizeof (mbox), buf);
p_delete(&mx.mbox);
imap_munge_mbox_name (mbox, sizeof (mbox), buf);
-
strfcpy (mbox_unquoted, buf, sizeof (mbox_unquoted)
);
+
m_strcpy(mbox_unquoted, sizeof(mbox_unquoted), buf
);
/* The draft IMAP implementor's guide warns againts using the STATUS
* command on a mailbox that you have selected
*/
/* The draft IMAP implementor's guide warns againts using the STATUS
* command on a mailbox that you have selected
*/
- if (
str_cmp
(mbox_unquoted, idata->mailbox) == 0
+ if (
m_strcmp
(mbox_unquoted, idata->mailbox) == 0
|| (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
|| (ascii_strcasecmp (mbox_unquoted, "INBOX") == 0
- &&
str_casecmp
(mbox_unquoted, idata->mailbox) == 0)) {
-
strfcpy (buf, "NOOP", sizeof (buf)
);
+ &&
m_strcasecmp
(mbox_unquoted, idata->mailbox) == 0)) {
+
m_strcpy(buf, sizeof(buf), "NOOP"
);
}
else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) ||
mutt_bit_isset (idata->capabilities, STATUS)) {
}
else if (mutt_bit_isset (idata->capabilities, IMAP4REV1) ||
mutt_bit_isset (idata->capabilities, STATUS)) {
@@
-1208,8
+1209,8
@@
int imap_mailbox_check (char *path, int new)
/* The mailbox name may or may not be quoted here. We could try to
* munge the server response and compare with quoted (or vise versa)
* but it is probably more efficient to just strncmp against both. */
/* The mailbox name may or may not be quoted here. We could try to
* munge the server response and compare with quoted (or vise versa)
* but it is probably more efficient to just strncmp against both. */
- if (
str_ncmp
(mbox_unquoted, s, m_strlen(mbox_unquoted)) == 0
- ||
str_ncmp
(mbox, s, m_strlen(mbox)) == 0) {
+ if (
m_strncmp
(mbox_unquoted, s, m_strlen(mbox_unquoted)) == 0
+ ||
m_strncmp
(mbox, s, m_strlen(mbox)) == 0) {
s = imap_next_word (s);
s = imap_next_word (s);
if (isdigit ((unsigned char) *s)) {
s = imap_next_word (s);
s = imap_next_word (s);
if (isdigit ((unsigned char) *s)) {
@@
-1345,7
+1346,7
@@
int imap_search (CONTEXT* ctx, const pattern_t* pat) {
if (!do_search (pat, 1))
return 0;
if (!do_search (pat, 1))
return 0;
-
memset (&buf, 0, sizeof (buf)
);
+
p_clear(&buf, 1
);
mutt_buffer_addstr (&buf, "UID SEARCH ");
if (imap_compile_search (pat, &buf) < 0) {
p_delete(&buf.data);
mutt_buffer_addstr (&buf, "UID SEARCH ");
if (imap_compile_search (pat, &buf) < 0) {
p_delete(&buf.data);
@@
-1457,7
+1458,7
@@
int imap_subscribe (char *path, int subscribe)
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
if (option (OPTIMAPCHECKSUBSCRIBED)) {
imap_fix_path (idata, mx.mbox, buf, sizeof (buf));
if (option (OPTIMAPCHECKSUBSCRIBED)) {
-
memset (&token, 0, sizeof (token)
);
+
p_clear(&token, 1
);
err.data = errstr;
err.dsize = sizeof (errstr);
snprintf (mbox, sizeof (mbox), "%smailboxes \"%s\"",
err.data = errstr;
err.dsize = sizeof (errstr);
snprintf (mbox, sizeof (mbox), "%smailboxes \"%s\"",
@@
-1513,9
+1514,9
@@
static int imap_complete_hosts (char *dest, size_t len) {
return (-1);
for (i = 0; i < Incoming->length; i++) {
mailbox = (BUFFY*) Incoming->data[i];
return (-1);
for (i = 0; i < Incoming->length; i++) {
mailbox = (BUFFY*) Incoming->data[i];
- if (!
str_ncmp
(dest, mailbox->path, matchlen)) {
+ if (!
m_strncmp
(dest, mailbox->path, matchlen)) {
if (rc) {
if (rc) {
-
strfcpy (dest, mailbox->path, len
);
+
m_strcpy(dest, len, mailbox->path
);
rc = 0;
} else
longest_common_prefix (dest, mailbox->path, matchlen, len);
rc = 0;
} else
longest_common_prefix (dest, mailbox->path, matchlen, len);
@@
-1534,9
+1535,9
@@
static int imap_complete_hosts (char *dest, size_t len) {
url.user = NULL;
url.path = NULL;
url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0);
url.user = NULL;
url.path = NULL;
url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0);
- if (!
str_ncmp
(dest, urlstr, matchlen)) {
+ if (!
m_strncmp
(dest, urlstr, matchlen)) {
if (rc) {
if (rc) {
-
strfcpy (dest, urlstr, len
);
+
m_strcpy(dest, len, urlstr
);
rc = 0;
} else
longest_common_prefix (dest, urlstr, matchlen, len);
rc = 0;
} else
longest_common_prefix (dest, urlstr, matchlen, len);
@@
-1562,7
+1563,7
@@
int imap_complete (char *dest, size_t dlen, char *path) {
IMAP_MBOX mx;
if (imap_parse_path (path, &mx) || !mx.mbox) {
IMAP_MBOX mx;
if (imap_parse_path (path, &mx) || !mx.mbox) {
-
strfcpy (dest, path, dlen
);
+
m_strcpy(dest, dlen, path
);
return imap_complete_hosts (dest, dlen);
}
return imap_complete_hosts (dest, dlen);
}
@@
-1570,7
+1571,7
@@
int imap_complete (char *dest, size_t dlen, char *path) {
* known mailboxes/hooks/etc */
if (!(idata = imap_conn_find (&(mx.account), M_IMAP_CONN_NONEW))) {
p_delete(&mx.mbox);
* known mailboxes/hooks/etc */
if (!(idata = imap_conn_find (&(mx.account), M_IMAP_CONN_NONEW))) {
p_delete(&mx.mbox);
-
strfcpy (dest, path, dlen
);
+
m_strcpy(dest, dlen, path
);
return imap_complete_hosts (dest, dlen);
}
conn = idata->conn;
return imap_complete_hosts (dest, dlen);
}
conn = idata->conn;
@@
-1589,7
+1590,7
@@
int imap_complete (char *dest, size_t dlen, char *path) {
imap_cmd_start (idata, buf);
/* and see what the results are */
imap_cmd_start (idata, buf);
/* and see what the results are */
-
strfcpy (completion, NONULL (mx.mbox), sizeof (completion
));
+
m_strcpy(completion, sizeof(completion), NONULL(mx.mbox
));
do {
if (imap_parse_list_response (idata, &list_word, &noselect, &noinferiors,
&delim))
do {
if (imap_parse_list_response (idata, &list_word, &noselect, &noinferiors,
&delim))
@@
-1608,7
+1609,7
@@
int imap_complete (char *dest, size_t dlen, char *path) {
}
/* copy in first word */
if (!completions) {
}
/* copy in first word */
if (!completions) {
-
strfcpy (completion, list_word, sizeof (completion)
);
+
m_strcpy(completion, sizeof(completion), list_word
);
matchlen = m_strlen(completion);
completions++;
continue;
matchlen = m_strlen(completion);
completions++;
continue;