* domain-literal = "[" *(dtext / quoted-pair) "]"
*/
- unsigned int l;
+ size_t l;
if (!msgid || !*msgid)
return false;
* @param type Buffer with mime type of attachment in "type/subtype" format
* @param len Buffer length
*/
-void mutt_check_lookup_list(struct Body *b, char *type, int len)
+void mutt_check_lookup_list(struct Body *b, char *type, size_t len)
{
int i;
#endif
{
/* add '/' at the end of the directory name if not already there */
- int len = mutt_str_strlen(buf);
+ size_t len = mutt_str_strlen(buf);
if ((len > 0) && (buf[len - 1] != '/') && (sizeof(buf) > (len + 1)))
{
buf[len] = '/';
struct BrowserState
{
struct FolderFile *entry;
- unsigned int entrylen; /**< number of real entries */
+ size_t entrylen; /**< number of real entries */
unsigned int entrymax; /**< max entry */
#ifdef USE_IMAP
bool imap_browse;
* @retval true User selected 'skip'
* @retval false Otherwise
*/
-static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int allow_always)
+static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int allow_always)
{
static const int part[] = {
NID_commonName, /* CN */
{
char buf[STRING];
const char *host = NULL;
- int len, pos;
+ size_t len;
+ int pos;
X509 *cert = NULL;
SSL *ssl = NULL;
int skip_mode;
}
else
{
- int blen = mutt_str_strlen(buf);
+ size_t blen = mutt_str_strlen(buf);
mutt_mem_realloc(&this_one, this_one_len + blen + sizeof(char));
strcat(this_one + this_one_len, buf);
char cbuf[STRING];
char c2buf[STRING];
char *p = NULL;
- int l, linelen, buflen, cbuflen, c2buflen, plen;
+ size_t l, linelen, buflen, cbuflen, c2buflen, plen;
linelen = mutt_str_strlen(*h);
plen = linelen;
static int address_header_decode(char **h)
{
char *s = *h;
- int l;
+ size_t l;
bool rp = false;
struct Address *a = NULL;
}
void mutt_progress_init(struct Progress *progress, const char *msg,
- unsigned short flags, unsigned short inc, long size)
+ unsigned short flags, unsigned short inc, size_t size)
{
struct timeval tv = { 0, 0 };
int offset = 0;
bool found = false;
int chunks = 0;
- int len = 0;
+ size_t len = 0;
struct Syntax
{
state_reset_prefix(s);
}
-void mutt_decode_base64(struct State *s, long len, int istext, iconv_t cd)
+void mutt_decode_base64(struct State *s, size_t len, int istext, iconv_t cd)
{
char buf[5];
int c1, c2, c3, c4, ch, i;
*/
static size_t add_index_color(char *buf, size_t buflen, enum FormatFlag flags, char color)
{
- int len;
+ size_t len;
/* only add color markers if we are operating on main index entries. */
if (!(flags & MUTT_FORMAT_INDEX))
unsigned char ipad[MD5_BLOCK_LEN], opad[MD5_BLOCK_LEN];
unsigned char secret[MD5_BLOCK_LEN + 1];
unsigned char hash_passwd[MD5_DIGEST_LEN];
- unsigned int secret_len, chal_len;
+ size_t secret_len, chal_len;
secret_len = strlen(password);
chal_len = strlen(challenge);
unsigned int seqno;
time_t lastread; /**< last time we read a command for the server */
char *buf;
- unsigned int blen;
+ size_t blen;
/* If nonzero, we can send UTF-8, and the server will use UTF8 rather
* than mUTF7 */
unsigned int uid_validity;
unsigned int uidnext;
struct Header **msn_index; /**< look up headers by (MSN-1) */
- unsigned int msn_index_size; /**< allocation size */
+ size_t msn_index_size; /**< allocation size */
unsigned int max_msn; /**< the largest MSN fetched so far */
struct BodyCache *bcache;
*
* Mapping from Message Sequence Number to Header
*/
-static void alloc_msn_index(struct ImapData *idata, unsigned int msn_count)
+static void alloc_msn_index(struct ImapData *idata, size_t msn_count)
{
unsigned int new_size;
struct AttachMatch *a = NULL;
char *p = NULL;
char *tmpminor = NULL;
- int len;
+ size_t len;
int ret;
do
*
* Changes the dest buffer if necessary/possible to aid completion.
*/
-static void candidate(char *dest, char *try, const char *src, int len)
+static void candidate(char *dest, char *try, const char *src, size_t len)
{
if (!dest || !try || !src)
return;
struct Keymap *Keymaps[MENU_MAX];
-static struct Keymap *alloc_keys(int len, keycode_t *keys)
+static struct Keymap *alloc_keys(size_t len, keycode_t *keys)
{
struct Keymap *p = NULL;
int retval = 0;
struct Keymap *map = NULL, *tmp = NULL, *last = NULL, *next = NULL;
keycode_t buf[MAX_SEQ];
- int len, pos = 0, lastpos = 0;
+ size_t len;
+ int pos = 0, lastpos = 0;
len = parsekeys(s, buf, MAX_SEQ);
if (to && from && (cd = mutt_iconv_open(to, from, flags)) != (iconv_t) -1)
{
- int len;
+ size_t len;
const char *ib = NULL;
char *buf = NULL, *ob = NULL;
size_t ibl, obl;
unsigned short flags;
const char *msg;
long pos;
- long size;
+ size_t size;
unsigned int timestamp;
char sizestr[SHORT_STRING];
};
void mutt_progress_init(struct Progress *progress, const char *msg,
- unsigned short flags, unsigned short inc, long size);
+ unsigned short flags, unsigned short inc, size_t size);
/* If percent is positive, it is displayed as percentage, otherwise
* percentage is calculated from progress->size and pos if progress
* was initialized with positive size, otherwise no percentage is shown */
FILE *f = NULL;
struct stat s;
- int len = mutt_str_strlen(path);
+ size_t len = mutt_str_strlen(path);
if (path[len - 1] == '|')
{
int mutt_is_application_smime(struct Body *m)
{
char *t = NULL;
- int len;
+ size_t len;
bool complain = false;
if (!m)
* Create a GPGME data object from the stream FP but limit the object
* to LENGTH bytes starting at OFFSET bytes from the beginning of the file.
*/
-static gpgme_data_t file_to_data_object(FILE *fp, long offset, long length)
+static gpgme_data_t file_to_data_object(FILE *fp, long offset, size_t length)
{
int err = 0;
gpgme_data_t data;
gpgme_user_id_t uid;
gpgme_subkey_t subkey;
const char *shortid = NULL;
- int len;
+ size_t len;
char date[STRING];
int more;
int rc = -1;
FILE *pgpin = NULL, *pgpout = NULL, *pgperr = NULL, *pgptmp = NULL;
struct stat info;
struct Body *tattach = NULL;
- int len;
+ size_t len;
char pgperrfile[_POSIX_PATH_MAX];
char pgptmpfile[_POSIX_PATH_MAX];
pid_t thepid;
*/
static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *out_file)
{
- int len = 0;
+ size_t len = 0;
int c;
char buf[HUGE_STRING];
char outfile[_POSIX_PATH_MAX], errfile[_POSIX_PATH_MAX];
if (!nntp_data)
{
- int len = strlen(group) + 1;
+ size_t len = strlen(group) + 1;
/* create NntpData structure and add it to hash */
nntp_data = mutt_mem_calloc(1, sizeof(struct NntpData) + len);
nntp_data->group = (char *) nntp_data + sizeof(struct NntpData);
off = colon + 1 - nserv->overview_fmt;
if (strcasecmp(nserv->overview_fmt + b, "Bytes:") == 0)
{
- int len = strlen(nserv->overview_fmt + b);
+ size_t len = strlen(nserv->overview_fmt + b);
mutt_str_strfcpy(nserv->overview_fmt + b, "Content-Length:", len + 1);
off = b + len;
}
*/
struct QClass
{
- int length;
+ size_t length;
int index;
int color;
char *prefix;
}
static struct QClass *classify_quote(struct QClass **quote_list, const char *qptr,
- int length, int *force_redraw, int *q_level)
+ size_t length, int *force_redraw, int *q_level)
{
struct QClass *q_list = *quote_list;
struct QClass *class = NULL, *tmp = NULL, *ptr = NULL, *save = NULL;
#ifdef SUN_ATTACHMENT
int lines;
#endif
- int blen, len, crlf = 0;
+ size_t blen, len;
+ int crlf = 0;
char buffer[LONG_STRING];
struct Body *head = NULL, *last = NULL, *new = NULL;
int i;
static void pgp_make_pgp2_fingerprint(unsigned char *buf, unsigned char *digest)
{
struct Md5Ctx ctx;
- unsigned int size = 0;
+ size_t size = 0;
mutt_md5_init_ctx(&ctx);
{
FILE *f = NULL;
int rc, index;
- long length;
+ size_t length;
char buf[LONG_STRING];
char tempfile[_POSIX_PATH_MAX];
rc = pop_query(pop_data, buf, sizeof(buf));
if (rc == 0)
{
- sscanf(buf, "+OK %d %ld", &index, &length);
+ sscanf(buf, "+OK %d %zu", &index, &length);
snprintf(buf, sizeof(buf), "TOP %d 0\r\n", h->refno);
rc = pop_fetch_data(pop_data, buf, NULL, fetch_message, f);
void mutt_clear_error(void);
void mutt_clear_pager_position(void);
void mutt_decode_attachment(struct Body *b, struct State *s);
-void mutt_decode_base64(struct State *s, long len, int istext, iconv_t cd);
+void mutt_decode_base64(struct State *s, size_t len, int istext, iconv_t cd);
void mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
void mutt_display_address(struct Envelope *env);
void mutt_draw_statusline(int cols, const char *buf, int buflen);
void mutt_free_enter_state(struct EnterState **esp);
void mutt_free_regex(struct Regex **pp);
void mutt_help(int menu);
-void mutt_check_lookup_list(struct Body *b, char *type, int len);
+void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
char buffer[STRING];
char *t = NULL;
char *fn = NULL;
- int len;
+ size_t len;
int tmplen;
int encode;
struct Address *tmp = NULL;
char buf[LONG_STRING];
int count = 0;
- int len;
+ size_t len;
while (adr)
{
* mutt_expando_format to do the actual work. mutt_expando_format will callback to
* us using sidebar_format_str() for the sidebar specific formatting characters.
*/
-static void make_sidebar_entry(char *buf, unsigned int buflen, int width,
+static void make_sidebar_entry(char *buf, size_t buflen, int width,
char *box, struct SbEntry *sbe)
{
if (!buf || !box || !sbe)
else if (w > width)
{
/* Truncate to fit */
- int len = mutt_wstr_trunc(buf, buflen, width, NULL);
+ size_t len = mutt_wstr_trunc(buf, buflen, width, NULL);
buf[len] = 0;
}
}
*/
int url_tostring(struct Url *u, char *dest, size_t len, int flags)
{
- long l;
+ size_t l;
if (u->scheme == U_UNKNOWN)
return -1;
*/
static void print_compile_options(struct CompileOptions *co)
{
- int len;
+ size_t len;
int used = 2;
bool tty = stdout ? isatty(fileno(stdout)) : false;