char line[STRING];
char decline[2 * STRING];
size_t l = 0;
- size_t linelen; /* number of input bytes in `line' */
size_t l3;
- int last; /* store the last character in the input line */
-
if (istext)
state_set_prefix(s);
if (fgets(line, MIN((ssize_t) sizeof(line), len + 1), s->fpin) == NULL)
break;
- linelen = strlen(line);
+ size_t linelen = strlen(line);
len -= linelen;
/*
* inspect the last character we read so we can tell if we got the
* entire line.
*/
- last = linelen ? line[linelen - 1] : 0;
+ const int last = linelen ? line[linelen - 1] : 0;
/* chop trailing whitespace if we got the full line */
if (last == '\n')
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;
+ int ch, i;
char bufi[BUFI_SIZE];
size_t l = 0;
break;
}
- c1 = base64val(buf[0]);
- c2 = base64val(buf[1]);
+ const int c1 = base64val(buf[0]);
+ const int c2 = base64val(buf[1]);
ch = (c1 << 2) | (c2 >> 4);
bufi[l++] = ch;
if (buf[2] == '=')
break;
- c3 = base64val(buf[2]);
+ const int c3 = base64val(buf[2]);
ch = ((c2 & 0xf) << 4) | (c3 >> 2);
bufi[l++] = ch;
if (buf[3] == '=')
break;
- c4 = base64val(buf[3]);
+ const int c4 = base64val(buf[3]);
ch = ((c3 & 0x3) << 6) | c4;
bufi[l++] = ch;
static void decode_uuencoded(struct State *s, long len, int istext, iconv_t cd)
{
char tmps[SHORT_STRING];
- char linelen, c, l, out;
+ char linelen;
char *pt = NULL;
char bufi[BUFI_SIZE];
size_t k = 0;
pt = tmps;
linelen = decode_byte(*pt);
pt++;
- for (c = 0; c < linelen;)
+ for (char c = 0; c < linelen;)
{
- for (l = 2; l <= 6; l += 2)
+ for (char l = 2; l <= 6; l += 2)
{
- out = decode_byte(*pt) << l;
+ char out = decode_byte(*pt) << l;
pt++;
out |= (decode_byte(*pt) >> (6 - l));
bufi[k++] = out;
static void enriched_wrap(struct EnrichedState *stte)
{
int x;
- int extra;
if (stte->line_len)
{
}
}
- extra = stte->wrap_margin - stte->line_len - stte->indent_len -
+ const int extra = stte->wrap_margin - stte->line_len - stte->indent_len -
(stte->tag_level[RICH_INDENT_RIGHT] * INDENT_SIZE);
if (extra > 0)
{
char *p = NULL;
const char *val = NULL;
char tmp[LONG_STRING], *q = NULL;
- int lng;
val = mutt_str_getenv("MM_NOASK");
if (val)
}
else
{
- lng = mutt_str_strlen(p);
+ const int lng = mutt_str_strlen(p);
if (buf[lng] == '/' && (mutt_str_strncasecmp(buf, p, lng) == 0))
return 1;
}
{
struct Body *choice = NULL;
struct Body *b = NULL;
- int type = 0;
bool mustfree = false;
int rc = 0;
- int count = 0;
if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
{
b = a->parts;
else
b = a;
+ int type = 0;
while (b)
{
if (b->type == TYPETEXT)
b = a->parts;
else
b = a;
+ int count = 0;
while (b)
{
if (choice != b)
if (s->flags & (MUTT_DISPLAY | MUTT_PRINTING))
{
char *length = NULL;
- char pretty_size[10];
state_mark_attach(s);
state_printf(s, _("[-- This %s/%s attachment "), TYPE(b->parts), b->parts->subtype);
length = mutt_param_get(&b->parameter, "length");
if (length)
{
+ char pretty_size[10];
mutt_str_pretty_size(pretty_size, sizeof(pretty_size), strtol(length, NULL, 10));
state_printf(s, _("(size %s bytes) "), pretty_size);
}
static int run_decode_and_handler(struct Body *b, struct State *s,
handler_t handler, int plaintext)
{
- int orig_type;
char *save_prefix = NULL;
FILE *fp = NULL;
-#ifndef USE_FMEMOPEN
- char tempfile[_POSIX_PATH_MAX];
-#endif
size_t tmplength = 0;
LOFF_T tmpoffset = 0;
int decode = 0;
* with 8bit encoding.
*/
{
- orig_type = b->type;
-
+ const int orig_type = b->type;
+#ifndef USE_FMEMOPEN
+ char tempfile[_POSIX_PATH_MAX];
+#endif
if (!plaintext)
{
/* decode to a tempfile, saving the original destination */