return false;
/* TODO: complete parser */
- for (unsigned int i = 0; i < l; i++)
+ for (size_t i = 0; i < l; i++)
if ((unsigned char) msgid[i] > 127)
return false;
*/
static void destroy_state(struct BrowserState *state)
{
- for (int c = 0; c < state->entrylen; c++)
+ for (size_t c = 0; c < state->entrylen; c++)
{
FREE(&((state->entry)[c].name));
FREE(&((state->entry)[c].desc));
}
else
{
- for (int i = 0; i < (int) n; i++)
+ for (unsigned int i = 0; i < n; i++)
{
char ch[8];
snprintf(ch, 8, "%02X%s", md[i], (i % 2 ? " " : ""));
snprintf(menu->dialog[row++], SHORT_STRING, _("MD5 Fingerprint: %s"), buf);
snprintf(title, sizeof(title),
- _("SSL Certificate check (certificate %d of %d in chain)"), len - idx, len);
+ _("SSL Certificate check (certificate %zu of %zu in chain)"), len - idx, len);
menu->title = title;
/* The leaf/host certificate can't be skipped. */
*/
void mutt_draw_statusline(int cols, const char *buf, int buflen)
{
- int i = 0;
- int offset = 0;
+ size_t i = 0;
+ size_t offset = 0;
bool found = false;
- int chunks = 0;
+ size_t chunks = 0;
size_t len = 0;
struct Syntax
if (len <= syntax[i].last)
goto dsl_finish; /* no more room */
- int next;
+ size_t next;
if ((i + 1) == chunks)
{
next = len;
*/
static void alloc_msn_index(struct ImapData *idata, size_t msn_count)
{
- unsigned int new_size;
+ size_t new_size;
if (msn_count <= idata->msn_index_size)
return;
return result;
}
-static int parsekeys(const char *str, keycode_t *d, int max)
+static size_t parsekeys(const char *str, keycode_t *d, size_t max)
{
- int n, len = max;
+ int n;
+ size_t len = max;
char buf[SHORT_STRING];
char c;
char *s = NULL, *t = NULL;
struct Keymap *map = NULL, *tmp = NULL, *last = NULL, *next = NULL;
keycode_t buf[MAX_SEQ];
size_t len;
- int pos = 0, lastpos = 0;
+ size_t pos = 0, lastpos = 0;
len = parsekeys(s, buf, MAX_SEQ);
*
* Note: it is assumed that `buf' is nul terminated!
*/
-int rfc822_write_address(char *buf, size_t buflen, struct Address *addr, int display)
+size_t rfc822_write_address(char *buf, size_t buflen, struct Address *addr, int display)
{
char *pbuf = buf;
size_t len = mutt_str_strlen(buf);
if (len > 0)
{
if (len > buflen)
- return pbuf - buf; /* safety check for bogus arguments */
+ return 0; /* safety check for bogus arguments */
pbuf += len;
buflen -= len;
}
}
-void mutt_pretty_size(char *s, size_t len, LOFF_T n)
+void mutt_pretty_size(char *s, size_t len, size_t n)
{
if (n == 0)
mutt_str_strfcpy(s, "0K", len);
struct stat s;
size_t len = mutt_str_strlen(path);
+ if (len == 0)
+ {
+ return NULL;
+ }
if (path[len - 1] == '|')
{
#ifdef SUN_ATTACHMENT
int lines;
#endif
- size_t blen, len;
- int crlf = 0;
+ size_t blen, len, crlf;
char buffer[LONG_STRING];
struct Body *head = NULL, *last = NULL, *new = NULL;
- int i;
bool final = false; /* did we see the ending boundary? */
if (!boundary)
}
/* Remove any trailing whitespace, up to the length of the boundary */
- for (i = len - 1; ISSPACE(buffer[i]) && i >= blen + 2; i--)
+ for (size_t i = len - 1; ISSPACE(buffer[i]) && i >= blen + 2; i--)
buffer[i] = 0;
/* Check for the end boundary */
void mutt_prepare_envelope(struct Envelope *env, int final);
void mutt_unprepare_envelope(struct Envelope *env);
void mutt_pretty_mailbox(char *s, size_t buflen);
-void mutt_pretty_size(char *s, size_t len, LOFF_T n);
+void mutt_pretty_size(char *s, size_t len, size_t n);
void mutt_pipe_message(struct Header *h);
void mutt_print_message(struct Header *h);
void mutt_query_exit(void);
bool message_is_tagged(struct Context *ctx, int index);
bool message_is_visible(struct Context *ctx, int index);
-int rfc822_write_address(char *buf, size_t buflen, struct Address *addr, int display);
+size_t rfc822_write_address(char *buf, size_t buflen, struct Address *addr, int display);
void rfc822_write_address_single(char *buf, size_t buflen, struct Address *addr, int display);
#endif /* _MUTT_PROTOS_H */
{
if (!(flags & U_PATH))
mutt_str_strcat(dest, len, "//");
- len -= (l = strlen(dest));
+ l = strlen(dest);
+ len -= l;
dest += l;
if (u->user && (u->user[0] || !(flags & U_PATH)))
else
snprintf(dest, len, "%s@", str);
- len -= (l = strlen(dest));
+ l = strlen(dest);
+ len -= l;
dest += l;
}
else
snprintf(dest, len, "%s", u->host);
- len -= (l = strlen(dest));
+ l = strlen(dest);
+ len -= l;
dest += l;
if (u->port)
*/
static void print_compile_options(struct CompileOptions *co)
{
- size_t len;
- int used = 2;
+ size_t len, used = 2;
bool tty = stdout ? isatty(fileno(stdout)) : false;
printf(" ");