From 39d11f5b3feb125654d5c2a4e8f93637a12706c3 Mon Sep 17 00:00:00 2001 From: pdmef Date: Fri, 18 Mar 2005 17:22:53 +0000 Subject: [PATCH] Rocco Rutte: s/strlen()/mutt_strlen()/ for imap git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@201 e385b8ad-14ed-0310-8656-cc95a2468c6d --- imap/auth_cram.c | 6 +++--- imap/auth_gss.c | 4 ++-- imap/auth_sasl.c | 4 ++-- imap/browse.c | 10 +++++----- imap/command.c | 4 ++-- imap/imap.c | 4 ++-- imap/message.c | 2 +- imap/utf7.c | 4 ++-- imap/util.c | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/imap/auth_cram.c b/imap/auth_cram.c index 3c9b5be..003e20d 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -98,7 +98,7 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method) */ mutt_to_base64 ((unsigned char *) ibuf, (unsigned char *) obuf, - strlen (obuf), sizeof (ibuf) - 2); + mutt_strlen (obuf), sizeof (ibuf) - 2); safe_strcat (ibuf, sizeof (ibuf), "\r\n"); mutt_socket_write (idata->conn, ibuf); @@ -131,8 +131,8 @@ static void hmac_md5 (const char *password, char *challenge, unsigned int secret_len, chal_len; int i; - secret_len = strlen (password); - chal_len = strlen (challenge); + secret_len = mutt_strlen (password); + chal_len = mutt_strlen (challenge); /* passwords longer than MD5_BLOCK_LEN bytes are substituted with their MD5 * digests */ diff --git a/imap/auth_gss.c b/imap/auth_gss.c index 780e303..09024c4 100644 --- a/imap/auth_gss.c +++ b/imap/auth_gss.c @@ -57,7 +57,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA * idata, const char *method) /* get an IMAP service ticket for the server */ snprintf (buf1, sizeof (buf1), "imap@%s", idata->conn->account.host); request_buf.value = buf1; - request_buf.length = strlen (buf1) + 1; + request_buf.length = mutt_strlen (buf1) + 1; maj_stat = gss_import_name (&min_stat, &request_buf, gss_nt_service_name, &target_name); if (maj_stat != GSS_S_COMPLETE) { @@ -199,7 +199,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA * idata, const char *method) /* server decides if principal can log in as user */ strncpy (buf1 + 4, idata->conn->account.user, sizeof (buf1) - 4); request_buf.value = buf1; - request_buf.length = 4 + strlen (idata->conn->account.user) + 1; + request_buf.length = 4 + mutt_strlen (idata->conn->account.user) + 1; maj_stat = gss_wrap (&min_stat, context, 0, GSS_C_QOP_DEFAULT, &request_buf, &cflags, &send_token); if (maj_stat != GSS_S_COMPLETE) { diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 4dac4ce..23949ea 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -128,10 +128,10 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method) if (irc == IMAP_CMD_RESPOND) { #ifdef USE_SASL2 if (sasl_decode64 - (idata->cmd.buf + 2, strlen (idata->cmd.buf + 2), buf, + (idata->cmd.buf + 2, mutt_strlen (idata->cmd.buf + 2), buf, LONG_STRING - 1, #else - if (sasl_decode64 (idata->cmd.buf + 2, strlen (idata->cmd.buf + 2), buf, + if (sasl_decode64 (idata->cmd.buf + 2, mutt_strlen (idata->cmd.buf + 2), buf, #endif &len) != SASL_OK) { dprint (1, diff --git a/imap/browse.c b/imap/browse.c index b9d9220..434d222 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -111,7 +111,7 @@ int imap_browse (char *path, struct browser_state *state) imap_unmunge_mbox_name (cur_folder); if (!noinferiors && cur_folder[0] && - (n = strlen (mbox)) < LONG_STRING - 1) { + (n = mutt_strlen (mbox)) < LONG_STRING - 1) { mbox[n++] = idata->delim; mbox[n] = '\0'; } @@ -362,7 +362,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, if (isparent) noselect = 1; /* prune current folder from output */ - if (isparent || mutt_strncmp (name, mx.mbox, strlen (name))) + if (isparent || mutt_strncmp (name, mx.mbox, mutt_strlen (name))) imap_add_folder (idata->delim, name, noselect, noinferiors, state, isparent); } @@ -417,9 +417,9 @@ static void imap_add_folder (char delim, char *folder, int noselect, (state->entry)[state->entrylen].name = safe_strdup (tmp); /* mark desc with delim in browser if it can have subfolders */ - if (!isparent && !noinferiors && strlen (relpath) < sizeof (relpath) - 1) { - relpath[strlen (relpath) + 1] = '\0'; - relpath[strlen (relpath)] = delim; + if (!isparent && !noinferiors && mutt_strlen (relpath) < sizeof (relpath) - 1) { + relpath[mutt_strlen (relpath) + 1] = '\0'; + relpath[mutt_strlen (relpath)] = delim; } (state->entry)[state->entrylen].desc = safe_strdup (relpath); diff --git a/imap/command.c b/imap/command.c index bd2ad17..d40c2a4 100644 --- a/imap/command.c +++ b/imap/command.c @@ -66,7 +66,7 @@ int imap_cmd_start (IMAP_DATA * idata, const char *cmd) cmd_make_sequence (idata); /* seq, space, cmd, \r\n\0 */ - outlen = strlen (idata->cmd.seq) + strlen (cmd) + 4; + outlen = mutt_strlen (idata->cmd.seq) + mutt_strlen (cmd) + 4; out = (char *) safe_malloc (outlen); snprintf (out, outlen, "%s %s\r\n", idata->cmd.seq, cmd); @@ -176,7 +176,7 @@ int imap_exec (IMAP_DATA * idata, const char *cmd, int flags) /* create sequence for command */ cmd_make_sequence (idata); /* seq, space, cmd, \r\n\0 */ - outlen = strlen (idata->cmd.seq) + strlen (cmd) + 4; + outlen = mutt_strlen (idata->cmd.seq) + mutt_strlen (cmd) + 4; out = (char *) safe_malloc (outlen); snprintf (out, outlen, "%s %s\r\n", idata->cmd.seq, cmd); diff --git a/imap/imap.c b/imap/imap.c index b97cea0..c609366 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1392,14 +1392,14 @@ int imap_complete (char *dest, size_t dlen, char *path) /* if the folder isn't selectable, append delimiter to force browse * to enter it on second tab. */ if (noselect) { - clen = strlen (list_word); + clen = mutt_strlen (list_word); list_word[clen++] = delim; list_word[clen] = '\0'; } /* copy in first word */ if (!completions) { strfcpy (completion, list_word, sizeof (completion)); - matchlen = strlen (completion); + matchlen = mutt_strlen (completion); completions++; continue; } diff --git a/imap/message.c b/imap/message.c index 90a6c39..2eb0277 100644 --- a/imap/message.c +++ b/imap/message.c @@ -934,7 +934,7 @@ static int msg_has_flag (LIST * flag_list, const char *flag) flag_list = flag_list->next; while (flag_list) { - if (!ascii_strncasecmp (flag_list->data, flag, strlen (flag_list->data))) + if (!ascii_strncasecmp (flag_list->data, flag, mutt_strlen (flag_list->data))) return 1; flag_list = flag_list->next; diff --git a/imap/utf7.c b/imap/utf7.c index 0941b83..b6a838d 100644 --- a/imap/utf7.c +++ b/imap/utf7.c @@ -233,7 +233,7 @@ void imap_utf7_encode (char **s) char *t = safe_strdup (*s); if (!mutt_convert_string (&t, Charset, "UTF-8", 0)) - utf8_to_utf7 (t, strlen (t), s, 0); + utf8_to_utf7 (t, mutt_strlen (t), s, 0); FREE (&t); } } @@ -241,7 +241,7 @@ void imap_utf7_encode (char **s) void imap_utf7_decode (char **s) { if (Charset) { - char *t = utf7_to_utf8 (*s, strlen (*s), 0, 0); + char *t = utf7_to_utf8 (*s, mutt_strlen (*s), 0, 0); if (t && !mutt_convert_string (&t, "UTF-8", Charset, 0)) { FREE (s); diff --git a/imap/util.c b/imap/util.c index 5c051a6..34ee36e 100644 --- a/imap/util.c +++ b/imap/util.c @@ -486,7 +486,7 @@ void imap_unmunge_mbox_name (char *s) buf = safe_strdup (s); if (buf) { imap_utf7_decode (&buf); - strncpy (s, buf, strlen (s)); + strncpy (s, buf, mutt_strlen (s)); } FREE (&buf); -- 2.20.1