···852852853853 context = create_gpgme_context ((protocol == GPGME_PROTOCOL_CMS));
854854 s = keylist;
855855- do {
855855+ do
856856+ {
856857 while (*s == ' ')
857858 s++;
858859 for (i=0; *s && *s != ' ' && i < sizeof(buf)-1;)
···10561057 /* convert GPGME raw hash name to RFC 2633 format */
10571058 snprintf (buf, buflen, "%s", algorithm_name);
10581059 ascii_strlower (buf);
10591059- } else {
10601060+ }
10611061+ else
10621062+ {
10601063 /* convert GPGME raw hash name to RFC 3156 format */
10611064 snprintf (buf, buflen, "pgp-%s", algorithm_name);
10621065 ascii_strlower (buf + 4);
···15821585 if the S/MIME key has no ID. This is quite an error.
15831586 */
15841587 state_puts (_("no signature fingerprint available"), s);
15851585- else {
15881588+ else
15891589+ {
15861590 state_puts (_("KeyID "), s);
15871591 state_puts (sig->fpr, s);
15881592 }
···1977198119781982 if (maybe_signed)
19791983 a->is_signed_data = 1;
19801980- if(r_is_signed)
19841984+ if (r_is_signed)
19811985 *r_is_signed = -1; /* A signature exists. */
1982198619831987 if ((s->flags & MUTT_DISPLAY))
19841988 state_attach_puts (_("[-- Begin signature "
19851989 "information --]\n"), s);
19861986- for(idx = 0; (res = show_one_sig_status (ctx, idx, s)) != -1; idx++)
19901990+ for (idx = 0; (res = show_one_sig_status (ctx, idx, s)) != -1; idx++)
19871991 {
19881992 if (res == 1)
19891993 anybad = 1;
···27662770 state_attach_puts (_("[-- Begin signature "
27672771 "information --]\n"), s);
27682772 have_any_sigs = 1;
27692769- for(idx=0;
27732773+ for (idx=0;
27702774 (res = show_one_sig_status (ctx, idx, s)) != -1;
27712775 idx++)
27722776 {
···28022806 * seems to be a reasonable guess.
28032807 */
2804280828052805- if(s->flags & MUTT_DISPLAY)
28092809+ if (s->flags & MUTT_DISPLAY)
28062810 {
28072811 if (needpass)
28082812 state_attach_puts (_("[-- BEGIN PGP MESSAGE --]\n\n"), s);
···41044108 size_t n;
4105410941064110 n = 0;
41074107- for(l=list; l; l = l->next)
41114111+ for (l=list; l; l = l->next)
41084112 {
41094109- for(s = l->data; *s; s++)
41134113+ for (s = l->data; *s; s++)
41104114 {
41114115 if (*s == '%' || *s == '+')
41124116 n += 2;
···41164120 }
41174121 n++; /* make sure to allocate at least one byte */
41184122 pattern = p = safe_calloc (1,n);
41194119- for(l=list; l; l = l->next)
41234123+ for (l=list; l; l = l->next)
41204124 {
41214125 s = l->data;
41224126 if (*s)
41234127 {
41244128 if (l != list)
41254129 *p++ = ' ';
41264126- for(s = l->data; *s; s++)
41304130+ for (s = l->data; *s; s++)
41274131 {
41284132 if (*s == '%')
41294133 {
···41784182 size_t n;
41794183 char **patarr;
4180418441814181- for(l=hints, n=0; l; l = l->next)
41854185+ for (l=hints, n=0; l; l = l->next)
41824186 {
41834187 if (l->data && *l->data)
41844188 n++;
···41874191 goto no_pgphints;
4188419241894193 patarr = safe_calloc (n+1, sizeof *patarr);
41904190- for(l=hints, n=0; l; l = l->next)
41944194+ for (l=hints, n=0; l; l = l->next)
41914195 {
41924196 if (l->data && *l->data)
41934197 patarr[n++] = safe_strdup (l->data);
···49854989 /* this initialization should only run one time, but it may be called by
49864990 * either pgp_gpgme_init or smime_gpgme_init */
49874991 static bool has_run = 0;
49884988- if (!has_run) {
49924992+ if (!has_run)
49934993+ {
49894994 gpgme_check_version(NULL);
49904995 gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
49914996#ifdef ENABLE_NLS
+4-4
crypt.c
···441441 !ascii_strcasecmp (p, "keys-only"))
442442 t |= PGPKEY;
443443444444- if(!t) t |= PGPENCRYPT; /* not necessarily correct, but... */
444444+ if (!t) t |= PGPENCRYPT; /* not necessarily correct, but... */
445445 }
446446447447 if (!ascii_strcasecmp (m->subtype, "pgp-signed"))
···473473 char *t=NULL;
474474 int len, complain=0;
475475476476- if(!m)
476476+ if (!m)
477477 return 0;
478478479479 if ((m->type & TYPEAPPLICATION) && m->subtype)
···665665 else if (a->type == TYPEMESSAGE &&
666666 ascii_strcasecmp(a->subtype, "delivery-status"))
667667 {
668668- if(a->encoding != ENC7BIT)
668668+ if (a->encoding != ENC7BIT)
669669 mutt_message_to_7bit (a, NULL);
670670 }
671671 else if (a->encoding == ENC8BIT)
···913913 crypt_fetch_signatures (signatures, a->parts, n);
914914 else
915915 {
916916- if((*n % 5) == 0)
916916+ if ((*n % 5) == 0)
917917 safe_realloc (signatures, (*n + 6) * sizeof (BODY **));
918918919919 (*signatures)[(*n)++] = a;
+6-3
curs_lib.c
···587587 progress->flags = flags;
588588 progress->msg = msg;
589589 progress->size = size;
590590- if (progress->size) {
590590+ if (progress->size)
591591+ {
591592 if (progress->flags & MUTT_PROGRESS_SIZE)
592593 mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
593594 progress->size);
···633634 update = 1;
634635635636 /* skip refresh if not enough time has passed */
636636- if (update && progress->timestamp && !gettimeofday (&tv, NULL)) {
637637+ if (update && progress->timestamp && !gettimeofday (&tv, NULL))
638638+ {
637639 now = ((unsigned int) tv.tv_sec * 1000)
638640 + (unsigned int) (tv.tv_usec / 1000);
639641 if (now && now - progress->timestamp < TimeInc)
···10791081 else
10801082 SavedCursor = cursor;
1081108310821082- if (curs_set (cursor) == ERR) {
10841084+ if (curs_set (cursor) == ERR)
10851085+ {
10831086 if (cursor == 1) /* cnorm */
10841087 curs_set (2); /* cvvis */
10851088 }
+8-4
curs_main.c
···627627 menu->custom_menu_redraw = index_menu_redraw;
628628 mutt_push_current_menu (menu);
629629630630- if (!attach_msg) {
630630+ if (!attach_msg)
631631+ {
631632 mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* force the buffy check after we
632633 enter the folder */
633634 }
···699700 menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd));
700701 mutt_system(cmd);
701702 }
702702- } else if (check == MUTT_FLAGS)
703703+ }
704704+ else if (check == MUTT_FLAGS)
703705 mutt_message _("Mailbox was externally modified.");
704706705707 /* avoid the message being overwritten by buffy */
···22112213 CHECK_MSGCOUNT;
22122214 CHECK_READONLY;
22132215 rc = mutt_label_message(tag ? NULL : CURHDR);
22142214- if (rc > 0) {
22162216+ if (rc > 0)
22172217+ {
22152218 Context->changed = 1;
22162219 menu->redraw = REDRAW_FULL;
22172220 /* L10N: This is displayed when the x-label on one or more
22182221 * messages is edited. */
22192222 mutt_message (_("%d labels changed."), rc);
22202223 }
22212221- else {
22242224+ else
22252225+ {
22222226 /* L10N: This is displayed when editing an x-label, but no messages
22232227 * were updated. Possibly due to canceling at the prompt or if the new
22242228 * label is the same as the old label. */
···8787 safe_realloc (&buf, sizeof (char *) * (*bufmax += 25));
8888 buf[(*buflen)++] = safe_strdup (tmp);
8989 }
9090- if (buf && *bufmax == *buflen) { /* Do not smash memory past buf */
9090+ if (buf && *bufmax == *buflen) /* Do not smash memory past buf */
9191+ {
9192 safe_realloc (&buf, sizeof (char *) * (++*bufmax));
9293 }
9394 if (buf) buf[*buflen] = NULL;
+4-2
enter.c
···9393 break;
94949595 /* If this works, we can stop now */
9696- if (dlen >= MB_LEN_MAX) {
9696+ if (dlen >= MB_LEN_MAX)
9797+ {
9798 wcrtomb (dest, 0, &st);
9899 return;
99100 }
···109110 p += wcrtomb (p, 0, &st);
110111111112 /* If it fits into the destination buffer, we can stop now */
112112- if (p - buf <= dlen) {
113113+ if (p - buf <= dlen)
114114+ {
113115 memcpy (dest, buf, p - buf);
114116 return;
115117 }
···169169 cmd = &idata->cmds[c];
170170 if (cmd->state == IMAP_CMD_NEW)
171171 {
172172- if (!ascii_strncmp (idata->buf, cmd->seq, SEQLEN)) {
172172+ if (!ascii_strncmp (idata->buf, cmd->seq, SEQLEN))
173173+ {
173174 if (!stillrunning)
174175 {
175176 /* first command in queue has finished - move queue pointer up */
+11-5
imap/imap.c
···155155 char buf[LONG_STRING*2], mbox[LONG_STRING];
156156 IMAP_DATA *idata;
157157158158- if (!ctx || !ctx->data) {
158158+ if (!ctx || !ctx->data)
159159+ {
159160 if (!(idata = imap_conn_find (&mx.account,
160161 option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)))
161162 {
162163 FREE (&mx.mbox);
163164 return -1;
164165 }
165165- } else {
166166+ }
167167+ else
168168+ {
166169 idata = ctx->data;
167170 }
168171···484487 else if ((rc = query_quadoption (OPT_SSLSTARTTLS,
485488 _("Secure connection with TLS?"))) == -1)
486489 goto err_close_conn;
487487- if (rc == MUTT_YES) {
490490+ if (rc == MUTT_YES)
491491+ {
488492 if ((rc = imap_exec (idata, "STARTTLS", IMAP_CMD_FAIL_OK)) == -1)
489493 goto bail;
490494 if (rc != -2)
···11861190 mutt_remove_trailing_ws (flags);
1187119111881192 mutt_buffer_addstr (cmd, " -FLAGS.SILENT (");
11891189- } else
11931193+ }
11941194+ else
11901195 mutt_buffer_addstr (cmd, " FLAGS.SILENT (");
1191119611921197 mutt_buffer_addstr (cmd, flags);
···2146215121472152/* imap_complete: given a partial IMAP folder path, return a string which
21482153 * adds as much to the path as is unique */
21492149-int imap_complete(char* dest, size_t dlen, char* path) {
21542154+int imap_complete(char* dest, size_t dlen, char* path)
21552155+{
21502156 IMAP_DATA* idata;
21512157 char list[LONG_STRING];
21522158 char buf[LONG_STRING*2];
+1-1
imap/message.c
···11361136 * Ideally we'd have a HEADER structure with flag info here... */
11371137 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
11381138 {
11391139- if(c == '\n' && last != '\r')
11391139+ if (c == '\n' && last != '\r')
11401140 len++;
1141114111421142 len++;
+9-5
imap/util.c
···358358 return -1;
359359 }
360360361361- if (n > 1) {
361361+ if (n > 1)
362362+ {
362363 if (sscanf (tmp, ":%hu%127s", &(mx->account.port), tmp) >= 1)
363364 mx->account.flags |= MUTT_ACCT_PORT;
364365 if (sscanf (tmp, "/%s", tmp) == 1)
···441442 }
442443443444 /* do the '=' substitution */
444444- if (home_match) {
445445+ if (home_match)
446446+ {
445447 *path++ = '=';
446448 /* copy remaining path, skipping delimiter */
447449 if (! hlen)
···619621{
620622 int quoted = 0;
621623622622- while (*s) {
623623- if (*s == '\\') {
624624+ while (*s)
625625+ {
626626+ if (*s == '\\')
627627+ {
624628 s++;
625629 if (*s)
626630 s++;
···844848 int i;
845849846850 tmp[SHORT_STRING-1] = 0;
847847- for(i=0;i < SHORT_STRING-2;i++,s++)
851851+ for (i=0;i < SHORT_STRING-2;i++,s++)
848852 {
849853 if (!*s || ISSPACE(*s))
850854 {
+32-17
init.c
···231231 int line = 0;
232232233233 pc = tok->dptr;
234234- do {
234234+ do
235235+ {
235236 if ((pc = strpbrk (pc, "\\`")))
236237 {
237238 /* skip any quoted chars */
···790791 }
791792 mutt_extract_token(&templ, s, 0);
792793793793- if (add_to_replace_list(list, buf->data, templ.data, err) != 0) {
794794+ if (add_to_replace_list(list, buf->data, templ.data, err) != 0)
795795+ {
794796 FREE(&templ.data);
795797 return -1;
796798 }
···885887 mutt_extract_token (&templ, s, 0);
886888887889 /* Add to the spam list. */
888888- if (add_to_replace_list (&SpamList, buf->data, templ.data, err) != 0) {
890890+ if (add_to_replace_list (&SpamList, buf->data, templ.data, err) != 0)
891891+ {
889892 FREE(&templ.data);
890893 return -1;
891894 }
···12381241 /* We must do our own walk here because remove_from_list() will only
12391242 * remove the LIST->data, not anything pointed to by the LIST->data. */
12401243 lastp = NULL;
12411241- for(lp = *ldata; lp; )
12441244+ for (lp = *ldata; lp; )
12421245 {
12431246 a = (ATTACH_MATCH *)lp->data;
12441247 dprint(5, (debugfile, "parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n",
···1277128012781281static int print_attach_list (LIST *lp, char op, char *name)
12791282{
12801280- while (lp) {
12831283+ while (lp)
12841284+ {
12811285 printf("attachments %c%s %s/%s\n", op, name,
12821286 ((ATTACH_MATCH *)lp->data)->major,
12831287 ((ATTACH_MATCH *)lp->data)->minor);
···12941298 LIST **listp;
1295129912961300 mutt_extract_token(buf, s, 0);
12971297- if (!buf->data || *buf->data == '\0') {
13011301+ if (!buf->data || *buf->data == '\0')
13021302+ {
12981303 strfcpy(err->data, _("attachments: no disposition"), err->dsize);
12991304 return -1;
13001305 }
···13021307 category = buf->data;
13031308 op = *category++;
1304130913051305- if (op == '?') {
13101310+ if (op == '?')
13111311+ {
13061312 mutt_endwin (NULL);
13071313 fflush (stdout);
13081314 printf("\nCurrent attachments settings:\n\n");
···13141320 return 0;
13151321 }
1316132213171317- if (op != '+' && op != '-') {
13231323+ if (op != '+' && op != '-')
13241324+ {
13181325 op = '+';
13191326 category--;
13201327 }
13211321- if (!ascii_strncasecmp(category, "attachment", strlen(category))) {
13281328+ if (!ascii_strncasecmp(category, "attachment", strlen(category)))
13291329+ {
13221330 if (op == '+')
13231331 listp = &AttachAllow;
13241332 else
13251333 listp = &AttachExclude;
13261334 }
13271327- else if (!ascii_strncasecmp(category, "inline", strlen(category))) {
13351335+ else if (!ascii_strncasecmp(category, "inline", strlen(category)))
13361336+ {
13281337 if (op == '+')
13291338 listp = &InlineAllow;
13301339 else
13311340 listp = &InlineExclude;
13321341 }
13331333- else {
13421342+ else
13431343+ {
13341344 strfcpy(err->data, _("attachments: invalid disposition"), err->dsize);
13351345 return -1;
13361346 }
···13441354 LIST **listp;
1345135513461356 mutt_extract_token(buf, s, 0);
13471347- if (!buf->data || *buf->data == '\0') {
13571357+ if (!buf->data || *buf->data == '\0')
13581358+ {
13481359 strfcpy(err->data, _("unattachments: no disposition"), err->dsize);
13491360 return -1;
13501361 }
1351136213521363 p = buf->data;
13531364 op = *p++;
13541354- if (op != '+' && op != '-') {
13651365+ if (op != '+' && op != '-')
13661366+ {
13551367 op = '+';
13561368 p--;
13571369 }
13581358- if (!ascii_strncasecmp(p, "attachment", strlen(p))) {
13701370+ if (!ascii_strncasecmp(p, "attachment", strlen(p)))
13711371+ {
13591372 if (op == '+')
13601373 listp = &AttachAllow;
13611374 else
13621375 listp = &AttachExclude;
13631376 }
13641364- else if (!ascii_strncasecmp(p, "inline", strlen(p))) {
13771377+ else if (!ascii_strncasecmp(p, "inline", strlen(p)))
13781378+ {
13651379 if (op == '+')
13661380 listp = &InlineAllow;
13671381 else
13681382 listp = &InlineExclude;
13691383 }
13701370- else {
13841384+ else
13851385+ {
13711386 strfcpy(err->data, _("unattachments: invalid disposition"), err->dsize);
13721387 return -1;
13731388 }
···18451860 if (!len)
18461861 return 0;
18471862 len--; /* save room for \0 */
18481848-#define ESC_CHAR(C) do { *p++ = '\\'; if (p - dst < len) *p++ = C; } while(0)
18631863+#define ESC_CHAR(C) do { *p++ = '\\'; if (p - dst < len) *p++ = C; } while (0)
18491864 while (p - dst < len && src && *src)
18501865 {
18511866 switch (*src)
+11-9
keymap.c
···149149 char *t;
150150 int n = 0;
151151152152- if(s[0] != '<' || ascii_tolower(s[1]) != 'f')
152152+ if (s[0] != '<' || ascii_tolower(s[1]) != 'f')
153153 return -1;
154154155155- for(t = s + 2; *t && isdigit((unsigned char) *t); t++)
155155+ for (t = s + 2; *t && isdigit((unsigned char) *t); t++)
156156 {
157157 n *= 10;
158158 n += *t - '0';
159159 }
160160161161- if(*t != '>')
161161+ if (*t != '>')
162162 return -1;
163163 else
164164 return n;
···176176 while (ISSPACE(*endChar))
177177 ++endChar;
178178 /* negative keycodes don't make sense, also detect overflow */
179179- if (*endChar != '>' || result < 0 || result == LONG_MAX) {
179179+ if (*endChar != '>' || result < 0 || result == LONG_MAX)
180180+ {
180181 return -1;
181182 }
182183···196197 while (*s && len)
197198 {
198199 *d = '\0';
199199- if(*s == '<' && (t = strchr(s, '>')))
200200+ if (*s == '<' && (t = strchr(s, '>')))
200201 {
201202 t++; c = *t; *t = '\0';
202203···219220 *t = c;
220221 }
221222222222- if(!*d)
223223+ if (!*d)
223224 {
224225 *d = (unsigned char)*s;
225226 s++;
···11541155 }
11551156 nops++;
11561157 }
11571157- while(MoreArgs(s) && nops < sizeof(ops)/sizeof(ops[0]));
11581158+ while (MoreArgs(s) && nops < sizeof(ops)/sizeof(ops[0]));
1158115911591159- while(nops)
11601160+ while (nops)
11601161 mutt_push_macro_event (0, ops[--nops]);
1161116211621163 return 0;
···11711172 int ch;
1172117311731174 mutt_window_mvprintw (MuttMessageWindow, 0, 0, _("Enter keys (^G to abort): "));
11741174- do {
11751175+ do
11761176+ {
11751177 ch = getch();
11761178 if (ch != ERR && ch != ctrl ('G'))
11771179 {
+15-12
lib.c
···400400{
401401 struct stat osb, nsb;
402402403403- if(!oldpath || !newpath)
403403+ if (!oldpath || !newpath)
404404 return -1;
405405406406- if(unlink(newpath) == -1 && errno != ENOENT)
406406+ if (unlink(newpath) == -1 && errno != ENOENT)
407407 return -1;
408408409409 if (oldpath[0] == '/')
···425425 return -1;
426426 }
427427428428- if(stat(oldpath, &osb) == -1 || stat(newpath, &nsb) == -1
429429- || compare_stat(&osb, &nsb) == -1)
428428+ if (stat(oldpath, &osb) == -1 || stat(newpath, &nsb) == -1
429429+ || compare_stat(&osb, &nsb) == -1)
430430 {
431431 unlink(newpath);
432432 return -1;
···866866{
867867 size_t i, j = 0;
868868869869- if(!f)
869869+ if (!f)
870870 {
871871 *d = '\0';
872872 return 0;
···877877878878 d[j++] = '\'';
879879880880- for(i = 0; j < l && f[i]; i++)
880880+ for (i = 0; j < l && f[i]; i++)
881881 {
882882- if(f[i] == '\'' || f[i] == '`')
882882+ if (f[i] == '\'' || f[i] == '`')
883883 {
884884 d[j++] = '\'';
885885 d[j++] = '\\';
···983983 req = dirlen + fnamelen + 1; /* +1 for the trailing nul */
984984 if (dirlen && fnamelen)
985985 req++; /* when both components are non-nul, we add a "/" in between */
986986- if (req > dstlen) { /* check for condition where the dst length is too short */
986986+ if (req > dstlen) /* check for condition where the dst length is too short */
987987+ {
987988 /* Two options here:
988989 * 1) assert(0) or return NULL to signal error
989990 * 2) copy as much of the path as will fit
···994995 return NULL;
995996 }
996997997997- if (dirlen) { /* when dir is not empty */
998998+ if (dirlen) /* when dir is not empty */
999999+ {
9981000 memcpy(dst, dir, dirlen);
9991001 offset = dirlen;
10001002 if (fnamelen)
10011003 dst[offset++] = '/';
10021004 }
10031003- if (fnamelen) { /* when fname is not empty */
10051005+ if (fnamelen) /* when fname is not empty */
10061006+ {
10041007 memcpy(dst + offset, fname, fnamelen);
10051008 offset += fnamelen;
10061009 }
···10331036{
10341037 int i;
1035103810361036- for(i = 0; sysexits_h[i].str; i++)
10391039+ for (i = 0; sysexits_h[i].str; i++)
10371040 {
10381038- if(e == sysexits_h[i].v)
10411041+ if (e == sysexits_h[i].v)
10391042 break;
10401043 }
10411044
+1-1
lib.h
···150150151151void mutt_debug (FILE *, const char *, ...);
152152153153-# define dprint(N,X) do { if(debuglevel>=N && debugfile) mutt_debug X; } while (0)
153153+# define dprint(N,X) do { if (debuglevel>=N && debugfile) mutt_debug X; } while (0)
154154155155# else
156156
···11211121 * likely be at the head of the list. but it is present for consistency with
11221122 * the check at the top of the for() loop in maildir_delayed_parsing().
11231123 */
11241124- while (!p->h || p->header_parsed) {
11241124+ while (!p->h || p->header_parsed)
11251125+ {
11251126 *last = p;
11261127 p = p->next;
11271128 }
···11501151#endif
1151115211521153#if HAVE_DIRENT_D_INO
11531153-#define DO_SORT() do { \
11541154+#define DO_SORT() \
11551155+ do \
11561156+ { \
11541157 if (!sort) \
11551158 { \
11561159 dprint (4, (debugfile, "maildir: need to sort %s by inode\n", ctx->path)); \
···11631166 p = skip_duplicates (p, &last); \
11641167 mutt_buffer_printf (fn, "%s/%s", ctx->path, p->h->path); \
11651168 } \
11661166- } while(0)
11691169+ } while (0)
11671170#else
11681171#define DO_SORT() /* nothing */
11691172#endif
···2660266326612664 realpath = mutt_buffer_pool_get ();
2662266526632663- do {
26662666+ do
26672667+ {
26642668 /* we do "cur" on the first iteration since its more likely that we'll
26652669 * find old messages without having to scan both subdirs
26662670 */
+5-3
mutt_sasl.c
···3737{
3838 int err;
3939 dprint (1, (debugfile, "getnameinfo: "));
4040- switch(ret)
4040+ switch (ret)
4141 {
4242 case EAI_AGAIN:
4343 dprint (1, (debugfile, "The name could not be resolved at this time. Future attempts may succeed.\n"));
···198198 }
199199200200 size = sizeof (local);
201201- if (!getsockname (conn->fd, (struct sockaddr *)&local, &size)) {
201201+ if (!getsockname (conn->fd, (struct sockaddr *)&local, &size))
202202+ {
202203 if (iptostring((struct sockaddr *)&local, size, iplocalport,
203204 IP_PORT_BUFLEN) == SASL_OK)
204205 plp = iplocalport;
···209210 dprint (2, (debugfile, "SASL failed to get local IP address\n"));
210211211212 size = sizeof (remote);
212212- if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size)){
213213+ if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size))
214214+ {
213215 if (iptostring((struct sockaddr *)&remote, size, ipremoteport,
214216 IP_PORT_BUFLEN) == SASL_OK)
215217 prp = ipremoteport;
+2-1
mutt_socket.c
···577577 FREE (&host_idna);
578578# endif
579579580580- if (! he) {
580580+ if (! he)
581581+ {
581582 mutt_error (_("Could not find the host \"%s\""), conn->account.host);
582583583584 return -1;
+8-4
mutt_ssl.c
···243243244244 ssl_get_client_cert(ssldata, conn);
245245246246- if (SslCiphers) {
247247- if (!SSL_CTX_set_cipher_list (ssldata->ctx, SslCiphers)) {
246246+ if (SslCiphers)
247247+ {
248248+ if (!SSL_CTX_set_cipher_list (ssldata->ctx, SslCiphers))
249249+ {
248250 dprint (1, (debugfile, "mutt_ssl_starttls: Could not select preferred ciphers\n"));
249251 goto bail_ctx;
250252 }
···503505504506 ssl_get_client_cert(data, conn);
505507506506- if (SslCiphers) {
508508+ if (SslCiphers)
509509+ {
507510 SSL_CTX_set_cipher_list (data->ctx, SslCiphers);
508511 }
509512···10121015 /* cast is safe since bufsize is incremented above, so bufsize-1 is always
10131016 * zero or greater.
10141017 */
10151015- if (mutt_strlen(buf) == (size_t)bufsize - 1) {
10181018+ if (mutt_strlen(buf) == (size_t)bufsize - 1)
10191019+ {
10161020 match_found = hostname_match(hostname_ascii, buf);
10171021 }
10181022 }
+17-9
mutt_ssl_gnutls.c
···140140 return -1;
141141 }
142142143143- do {
143143+ do
144144+ {
144145 ret = gnutls_record_recv (data->state, buf, len);
145146 if (ret < 0 && gnutls_error_is_fatal(ret) == 1)
146147 {
···425426 mutt_sleep (1);
426427 }
427428428428- if (tls_set_priority(data) < 0) {
429429+ if (tls_set_priority(data) < 0)
430430+ {
429431 goto fail;
430432 }
431433···446448 {
447449 err = gnutls_handshake(data->state);
448450 }
449449- if (err < 0) {
451451+ if (err < 0)
452452+ {
450453 if (err == GNUTLS_E_FATAL_ALERT_RECEIVED)
451454 {
452455 mutt_error("gnutls_handshake: %s(%s)", gnutls_strerror(err),
···469472470473 tls_get_client_cert (conn);
471474472472- if (!option(OPTNOCURSES)) {
475475+ if (!option(OPTNOCURSES))
476476+ {
473477 mutt_message (_("SSL/TLS connection using %s (%s/%s/%s)"),
474478 gnutls_protocol_get_name (gnutls_protocol_get_version (data->state)),
475479 gnutls_kx_get_name (gnutls_kx_get (data->state)),
···544548 b64_data.data = b64_data_data;
545549546550 fd1 = fopen(SslCertFile, "r");
547547- if (fd1 == NULL) {
551551+ if (fd1 == NULL)
552552+ {
548553 return 0;
549554 }
550555551556 b64_data.size = fread(b64_data.data, 1, b64_data.size, fd1);
552557 safe_fclose (&fd1);
553558554554- do {
559559+ do
560560+ {
555561 ret = gnutls_pem_base64_decode_alloc(NULL, &b64_data, &cert);
556562 if (ret != 0)
557563 {
···656662 tls_fingerprint (GNUTLS_DIG_MD5, buf, sizeof (buf), cert);
657663 while ((linestr = mutt_read_line(linestr, &linestrsize, fp, &linenum, 0)) != NULL)
658664 {
659659- if(linestr[0] == '#' && linestr[1] == 'H')
665665+ if (linestr[0] == '#' && linestr[1] == 'H')
660666 {
661667 if (regexec(&preg, linestr, 3, pmatch, 0) == 0)
662668 {
···11431149 * from most specific to least checking these. If we see a saved certificate,
11441150 * its status short-circuits the remaining checks. */
11451151 preauthrc = 0;
11461146- for (i = 0; i < cert_list_size; i++) {
11521152+ for (i = 0; i < cert_list_size; i++)
11531153+ {
11471154 rc = tls_check_preauth(&cert_list[i], certstat, conn->account.host, i,
11481155 &certerr, &savedcert);
11491156 preauthrc += rc;
···11711178 i, cert_list_size);
1172117911731180 /* add signers to trust set, then reverify */
11741174- if (i && rc) {
11811181+ if (i && rc)
11821182+ {
11751183 rc = gnutls_certificate_set_x509_trust_mem (data->xcred, &cert_list[i],
11761184 GNUTLS_X509_FMT_DER);
11771185 if (rc != 1)
+12-8
muttlib.c
···377377378378void mutt_free_header (HEADER **h)
379379{
380380- if(!h || !*h) return;
380380+ if (!h || !*h) return;
381381 mutt_free_envelope (&(*h)->env);
382382 mutt_free_body (&(*h)->content);
383383 FREE (&(*h)->maildir_flags);
···669669 return;
670670 }
671671672672- for(q = *p; q; q = q->next)
672672+ for (q = *p; q; q = q->next)
673673 {
674674 if (ascii_strcasecmp (attribute, q->attribute) == 0)
675675 {
···712712 break;
713713714714 case TYPEAPPLICATION:
715715- if((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(m))
715715+ if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(m))
716716 return 0;
717717- if((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m))
717717+ if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m))
718718 return 0;
719719 break;
720720···12801280 command = mutt_buffer_new ();
1281128112821282 /* Iterate expansions across successive arguments */
12831283- do {
12831283+ do
12841284+ {
12841285 char *p;
1285128612861287 /* Extract the command name and copy to command line */
···13211322 rc = mutt_wait_filter(pid);
13221323 if (rc != 0)
13231324 dprint(1, (debugfile, "format pipe command exited code %d\n", rc));
13241324- if (n > 0) {
13251325+ if (n > 0)
13261326+ {
13251327 dest[n] = 0;
13261328 while ((n > 0) && (dest[n-1] == '\n' || dest[n-1] == '\r'))
13271329 dest[--n] = '\0';
···20572059 /* Ensure that the integer conversion succeeded (e!=p) and bounds check. The upper bound check
20582060 * should not strictly be necessary since add_to_spam_list() finds the largest value, and
20592061 * the static array above is always large enough based on that value. */
20602060- if (e != p && n >= 0 && n <= l->nmatch && pmatch[n].rm_so != -1) {
20622062+ if (e != p && n >= 0 && n <= l->nmatch && pmatch[n].rm_so != -1)
20632063+ {
20612064 /* copy as much of the substring match as will fit in the output buffer, saving space for
20622065 * the terminating nul char */
20632066 int idx;
···20762079 * terminal nul char. This should avoid returning an unterminated
20772080 * string to the caller. When textsize<=0 we make no assumption about
20782081 * the validity of the text pointer. */
20792079- if (tlen < textsize) {
20822082+ if (tlen < textsize)
20832083+ {
20802084 text[tlen] = '\0';
20812085 dprint (5, (debugfile, "mutt_match_spam_list: \"%s\"\n", text));
20822086 }
+4-4
mx.c
···150150151151 snprintf(msg, sizeof(msg), _("Lock count exceeded, remove lock for %s?"),
152152 path);
153153- if(retry && mutt_yesorno(msg, MUTT_YES) == MUTT_YES)
153153+ if (retry && mutt_yesorno(msg, MUTT_YES) == MUTT_YES)
154154 {
155155 flags |= DL_FL_FORCE;
156156 retry--;
···386386 FILE *f;
387387388388#ifdef USE_IMAP
389389- if(mx_is_imap(path))
389389+ if (mx_is_imap(path))
390390 return MUTT_IMAP;
391391#endif /* USE_IMAP */
392392···677677 struct utimbuf ut;
678678#endif /* HAVE_UTIMENSAT */
679679680680- if(!ctx)
680680+ if (!ctx)
681681 return;
682682683683 /* fix up the times so buffy won't get confused */
···13001300 msg->received = hdr->received;
13011301 }
1302130213031303- if(msg->received == 0)
13031303+ if (msg->received == 0)
13041304 time(&msg->received);
1305130513061306 if (dest->mx_ops->open_new_msg (msg, dest, hdr) == 0)
···105105 Score = ptr;
106106 ptr->pat = pat;
107107 ptr->str = pattern;
108108- } else
108108+ }
109109+ else
109110 /* 'buf' arg was cleared and 'pattern' holds the only reference;
110111 * as here 'ptr' != NULL -> update the value only in which case
111112 * ptr->str already has the string, so pattern should be freed.
+6-5
send.c
···303303 {
304304 FREE(&env->message_id);
305305 env->message_id = tmp;
306306- } else
306306+ }
307307+ else
307308 FREE(&tmp);
308309 }
309310 else if (ascii_strncasecmp ("to:", uh->data, 3) != 0 &&
···558559559560 if ((flags & SENDGROUPREPLY) && (!in->mail_followup_to || hmfupto != MUTT_YES))
560561 {
561561- /* if(!mutt_addr_is_user(in->to)) */
562562+ /* if (!mutt_addr_is_user(in->to)) */
562563 rfc822_append (&out->cc, in->to, 1);
563564 rfc822_append (&out->cc, in->cc, 1);
564565 }
···672673 LIST **p = NULL, **q = NULL;
673674 int i;
674675675675- for(i = 0; i < ctx->vcount; i++)
676676+ for (i = 0; i < ctx->vcount; i++)
676677 {
677678 h = ctx->hdrs[ctx->v2r[i]];
678679 if (h->tagged)
···10981099 {
10991100 if (clear_content->type == TYPEMULTIPART)
11001101 {
11011101- if(!(msg->security & ENCRYPT) && (msg->security & SIGN))
11021102+ if (!(msg->security & ENCRYPT) && (msg->security & SIGN))
11021103 {
11031104 /* save initial signature and attachments */
11041105 save_sig = msg->content->parts->next;
···14501451 if ((i = query_quadoption (OPT_RECALL, _("Recall postponed message?"))) == -1)
14511452 return rv;
1452145314531453- if(i == MUTT_YES)
14541454+ if (i == MUTT_YES)
14541455 flags |= SENDPOSTPONED;
14551456 }
14561457