Projects STRLCPY neomutt Commits 50ab25a5
🤬
  • merge: trivial fixes

    * tidy logic
     * pattern: increase size of min/max
     * simple_format: check for failure in wcrtomb()
     * date: timezones are smaller than time_t
     * bool mutt_edit_attachment
     * bool mutt_is_quote_line
     * bool pattern
     * bool ssl_load_certificates
     * bool ssl_set_verify_partial
     * bool tls_check_stored_hostname
  • Loading...
  • Richard Russon committed 2 years ago
    50ab25a5
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    attach/mutt_attach.c
    skipped 246 lines
    247 247  /**
    248 248   * mutt_edit_attachment - Edit an attachment
    249 249   * @param a Email containing attachment
    250  - * @retval 1 Editor found
    251  - * @retval 0 Editor not found
     250 + * @retval true Editor found
     251 + * @retval false Editor not found
    252 252   *
    253 253   * Currently, this only works for send mode, as it assumes that the
    254 254   * Body->filename actually contains the information. I'm not sure
    skipped 2 lines
    257 257   *
    258 258   * Returning 0 is useful to tell the calling menu to redraw
    259 259   */
    260  -int mutt_edit_attachment(struct Body *a)
     260 +bool mutt_edit_attachment(struct Body *a)
    261 261  {
    262 262   char type[256] = { 0 };
    263 263   struct MailcapEntry *entry = mailcap_entry_new();
    264 264   bool unlink_newfile = false;
    265  - int rc = 0;
     265 + bool rc = false;
    266 266   struct Buffer *cmd = mutt_buffer_pool_get();
    267 267   struct Buffer *newfile = mutt_buffer_pool_get();
    268 268   
    skipped 41 lines
    310 310   else
    311 311   {
    312 312   mutt_error(_("No mailcap edit entry for %s"), type);
    313  - rc = 0;
    314 313   goto bailout;
    315 314   }
    316 315   
    317  - rc = 1;
     316 + rc = true;
    318 317   
    319 318  bailout:
    320 319   
    skipped 993 lines
  • ■ ■ ■ ■
    attach/mutt_attach.h
    skipped 73 lines
    74 74  void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
    75 75  int mutt_compose_attachment(struct Body *a);
    76 76  int mutt_decode_save_attachment(FILE *fp, struct Body *m, const char *path, int displaying, enum SaveAttach opt);
    77  -int mutt_edit_attachment(struct Body *a);
     77 +bool mutt_edit_attachment(struct Body *a);
    78 78  int mutt_get_tmp_attachment(struct Body *a);
    79 79  int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
    80 80  int mutt_print_attachment(FILE *fp, struct Body *a);
    skipped 8 lines
  • ■ ■ ■ ■ ■ ■
    attach/recvattach.c
    skipped 1065 lines
    1066 1066   struct Body *new_body = NULL;
    1067 1067   FILE *fp_new = NULL;
    1068 1068   SecurityFlags type;
    1069  - int need_secured, secured;
    1070 1069   
    1071 1070   for (m = parts; m; m = m->next)
    1072 1071   {
    1073  - need_secured = 0;
    1074  - secured = 0;
     1072 + bool need_secured = false;
     1073 + bool secured = false;
    1075 1074   
    1076 1075   if (((WithCrypto & APPLICATION_SMIME) != 0) && (type = mutt_is_application_smime(m)))
    1077 1076   {
    1078  - need_secured = 1;
     1077 + need_secured = true;
    1079 1078   
    1080 1079   if (type & SEC_ENCRYPT)
    1081 1080   {
    skipped 4 lines
    1086 1085   crypt_smime_getkeys(e->env);
    1087 1086   }
    1088 1087   
    1089  - secured = !crypt_smime_decrypt_mime(fp, &fp_new, m, &new_body);
     1088 + secured = (crypt_smime_decrypt_mime(fp, &fp_new, m, &new_body) == 0);
    1090 1089   /* If the decrypt/verify-opaque doesn't generate mime output, an empty
    1091 1090   * text/plain type will still be returned by mutt_read_mime_header().
    1092 1091   * We can't distinguish an actual part from a failure, so only use a
    skipped 13 lines
    1106 1105   if (((WithCrypto & APPLICATION_PGP) != 0) &&
    1107 1106   (mutt_is_multipart_encrypted(m) || mutt_is_malformed_multipart_pgp_encrypted(m)))
    1108 1107   {
    1109  - need_secured = 1;
     1108 + need_secured = true;
    1110 1109   
    1111 1110   if (!crypt_valid_passphrase(APPLICATION_PGP))
    1112 1111   goto decrypt_failed;
    1113 1112   
    1114  - secured = !crypt_pgp_decrypt_mime(fp, &fp_new, m, &new_body);
     1113 + secured = (crypt_pgp_decrypt_mime(fp, &fp_new, m, &new_body) == 0);
    1115 1114   
    1116 1115   if (secured)
    1117 1116   e->security |= PGP_ENCRYPT;
    skipped 130 lines
  • ■ ■ ■ ■
    color/attr.c
    skipped 172 lines
    173 173   */
    174 174  bool attr_color_match(struct AttrColor *ac1, struct AttrColor *ac2)
    175 175  {
    176  - if (!ac1 ^ !ac2) // One is set, but not the other
     176 + if ((!ac1) ^ (!ac2)) // One is set, but not the other
    177 177   return false;
    178 178   
    179 179   if (!ac1) // Two empty colours match
    skipped 5 lines
  • ■ ■ ■ ■
    color/regex.c
    skipped 226 lines
    227 227   struct CursesColor *cc = ac->curses_color;
    228 228   
    229 229   // different colours
    230  - if (!cc || (cc && ((cc->fg != fg) || (cc->bg != bg))))
     230 + if (!cc || (cc->fg != fg) || (cc->bg != bg))
    231 231   {
    232 232   cc = curses_color_new(fg, bg);
    233 233   if (cc)
    skipped 216 lines
  • ■ ■ ■ ■ ■ ■
    config/set.c
    skipped 141 lines
    142 142   if (!he)
    143 143   return NULL; /* LCOV_EXCL_LINE */
    144 144   
    145  - if (cst && cst->reset)
     145 + if (cst->reset)
    146 146   cst->reset(cs, &cdef->var, cdef, err);
    147 147   
    148 148   return he;
    skipped 81 lines
    230 230   return NULL;
    231 231   
    232 232   type = DTYPE(type);
    233  - if ((type < 1) || (type >= mutt_array_size(cs->types)))
     233 + if (type >= mutt_array_size(cs->types))
    234 234   return NULL;
    235 235   
    236 236   if (!cs->types[type].name)
    skipped 779 lines
  • ■ ■ ■ ■
    config/string.c
    skipped 183 lines
    184 184   const char *value, struct Buffer *err)
    185 185  {
    186 186   /* Skip if the value is missing or empty string*/
    187  - if (!value || (value && (value[0] == '\0')))
     187 + if (!value || (value[0] == '\0'))
    188 188   return CSR_SUCCESS | CSR_SUC_NO_CHANGE;
    189 189   
    190 190   int rc = CSR_SUCCESS;
    skipped 80 lines
  • ■ ■ ■ ■ ■
    conn/dlg_verifycert.c
    skipped 80 lines
    81 81   */
    82 82  static int menu_dialog_dokey(struct Menu *menu, int *id)
    83 83  {
    84  - struct KeyEvent ch = { OP_NULL, OP_NULL };
    85  - 
    86 84   // enum MuttCursorState cursor = mutt_curses_set_cursor(MUTT_CURSOR_VISIBLE);
    87  - ch = mutt_getch_timeout(5000);
     85 + struct KeyEvent ch = mutt_getch_timeout(5000);
    88 86   // mutt_curses_set_cursor(cursor);
    89 87   
    90 88   if ((ch.op == OP_TIMEOUT) || (ch.op == OP_ABORT))
    skipped 231 lines
  • ■ ■ ■ ■ ■ ■
    conn/gnutls.c
    skipped 183 lines
    184 184   * tls_check_stored_hostname - Does the hostname match a stored certificate?
    185 185   * @param cert Certificate
    186 186   * @param hostname Hostname
    187  - * @retval 1 Hostname match found
    188  - * @retval 0 Error, or no match
     187 + * @retval true Hostname match found
     188 + * @retval false Error, or no match
    189 189   */
    190  -static int tls_check_stored_hostname(const gnutls_datum_t *cert, const char *hostname)
     190 +static bool tls_check_stored_hostname(const gnutls_datum_t *cert, const char *hostname)
    191 191  {
    192 192   char *linestr = NULL;
    193 193   size_t linestrsize = 0;
    skipped 2 lines
    196 196   const char *const c_certificate_file = cs_subset_path(NeoMutt->sub, "certificate_file");
    197 197   FILE *fp = mutt_file_fopen(c_certificate_file, "r");
    198 198   if (!fp)
    199  - return 0;
     199 + return false;
    200 200   
    201 201   char buf[80] = { 0 };
    202 202   buf[0] = '\0';
    skipped 12 lines
    215 215   {
    216 216   FREE(&linestr);
    217 217   mutt_file_fclose(&fp);
    218  - return 1;
     218 + return true;
    219 219   }
    220 220   }
    221 221   }
    skipped 1 lines
    223 223   mutt_file_fclose(&fp);
    224 224   
    225 225   /* not found a matching name */
    226  - return 0;
     226 + return false;
    227 227  }
    228 228   
    229 229  /**
    skipped 929 lines
  • ■ ■ ■ ■ ■ ■
    conn/openssl.c
    skipped 111 lines
    112 112   * Previously the code used this form:
    113 113   * SSL_CTX_load_verify_locations (ssldata->ctx, `$certificate_file`, NULL);
    114 114   */
    115  -static int ssl_load_certificates(SSL_CTX *ctx)
     115 +static bool ssl_load_certificates(SSL_CTX *ctx)
    116 116  {
    117  - int rc = 1;
     117 + bool rc = true;
    118 118   
    119 119   mutt_debug(LL_DEBUG2, "loading trusted certificates\n");
    120 120   X509_STORE *store = SSL_CTX_get_cert_store(ctx);
    skipped 25 lines
    146 146   }
    147 147   /* PEM_read_X509 sets the error NO_START_LINE on eof */
    148 148   if (ERR_GET_REASON(ERR_peek_last_error()) != PEM_R_NO_START_LINE)
    149  - rc = 0;
     149 + rc = false;
    150 150   ERR_clear_error();
    151 151   
    152 152   X509_free(cert);
    skipped 5 lines
    158 158  /**
    159 159   * ssl_set_verify_partial - Allow verification using partial chains (with no root)
    160 160   * @param ctx SSL context
    161  - * @retval 0 Success
    162  - * @retval -1 Error
     161 + * @retval true Success
     162 + * @retval false Error
    163 163   */
    164  -static int ssl_set_verify_partial(SSL_CTX *ctx)
     164 +static bool ssl_set_verify_partial(SSL_CTX *ctx)
    165 165  {
    166  - int rc = 0;
     166 + bool rc = true;
    167 167  #ifdef HAVE_SSL_PARTIAL_CHAIN
    168 168   X509_VERIFY_PARAM *param = NULL;
    169 169   
    skipped 7 lines
    177 177   if (SSL_CTX_set1_param(ctx, param) == 0)
    178 178   {
    179 179   mutt_debug(LL_DEBUG2, "SSL_CTX_set1_param() failed\n");
    180  - rc = -1;
     180 + rc = false;
    181 181   }
    182 182   X509_VERIFY_PARAM_free(param);
    183 183   }
    184 184   else
    185 185   {
    186 186   mutt_debug(LL_DEBUG2, "X509_VERIFY_PARAM_new() failed\n");
    187  - rc = -1;
     187 + rc = false;
    188 188   }
    189 189   }
    190 190  #endif
    skipped 1072 lines
    1263 1263   SSL_CTX_set_cipher_list(sockdata(conn)->sctx, c_ssl_ciphers);
    1264 1264   }
    1265 1265   
    1266  - if (ssl_set_verify_partial(sockdata(conn)->sctx))
     1266 + if (!ssl_set_verify_partial(sockdata(conn)->sctx))
    1267 1267   {
    1268 1268   mutt_error(_("Warning: error enabling ssl_verify_partial_chains"));
    1269 1269   }
    skipped 163 lines
  • ■ ■ ■ ■ ■ ■
    copy.c
    skipped 305 lines
    306 306   struct ListNode *np = NULL;
    307 307   x = 0;
    308 308   int match = -1;
    309  - size_t match_len = 0, hdr_order_len;
     309 + size_t match_len = 0;
    310 310   
    311 311   STAILQ_FOREACH(np, &HeaderOrderList, entries)
    312 312   {
    313 313   x++;
    314  - hdr_order_len = mutt_str_len(np->data);
     314 + size_t hdr_order_len = mutt_str_len(np->data);
    315 315   if (mutt_istrn_equal(buf, np->data, hdr_order_len))
    316 316   {
    317 317   if ((match == -1) || (hdr_order_len > match_len))
    skipped 879 lines
  • ■ ■ ■ ■ ■ ■
    enter/functions.c
    skipped 706 lines
    707 707   return FR_UNKNOWN;
    708 708   
    709 709   struct EnterWindowData *wdata = win->wdata;
    710  - if (!wdata)
    711  - return FR_UNKNOWN;
    712 710   
    713 711   int rc = FR_UNKNOWN;
    714 712   for (size_t i = 0; EnterFunctions[i].op != OP_NULL; i++)
    skipped 18 lines
  • ■ ■ ■ ■ ■ ■
    gui/curs_lib.c
    skipped 294 lines
    295 295   /* send ALT-x as ESC-x */
    296 296   ch &= ~0x80;
    297 297   mutt_unget_ch(ch);
    298  - ch = '\033';
    299 298   return (struct KeyEvent){ .ch = '\033' /* Escape */, .op = OP_NULL };
    300 299   }
    301 300   
    skipped 341 lines
    643 642  {
    644 643   wchar_t wc = 0;
    645 644   int w;
    646  - size_t k, k2;
     645 + size_t k;
    647 646   char scratch[MB_LEN_MAX] = { 0 };
    648 647   mbstate_t mbstate1 = { 0 };
    649 648   mbstate_t mbstate2 = { 0 };
    skipped 38 lines
    688 687   }
    689 688   if (w >= 0)
    690 689   {
    691  - if ((w > max_width) || ((k2 = wcrtomb(scratch, wc, &mbstate2)) > buflen))
     690 + if (w > max_width)
    692 691   continue;
     692 + size_t k2 = wcrtomb(scratch, wc, &mbstate2);
     693 + if ((k2 == (size_t) -1) || (k2 > buflen))
     694 + continue;
     695 + 
    693 696   min_width -= w;
    694 697   max_width -= w;
    695 698   strncpy(p, scratch, k2);
    skipped 254 lines
  • ■ ■ ■ ■
    index/dlg_index.c
    skipped 225 lines
    226 226   struct Email *e = mutt_get_virt_email(m, index);
    227 227   if (e && e->collapsed)
    228 228   {
    229  - index = mutt_uncollapse_thread(e);
     229 + mutt_uncollapse_thread(e);
    230 230   mutt_set_vnum(m);
    231 231   }
    232 232  }
    skipped 1214 lines
  • ■ ■ ■ ■
    index/functions.c
    skipped 2608 lines
    2609 2609  static int op_main_entire_thread(struct IndexSharedData *shared,
    2610 2610   struct IndexPrivateData *priv, int op)
    2611 2611  {
    2612  - char buf[PATH_MAX] = { 0 };
    2613 2612   if (shared->mailbox->type != MUTT_NOTMUCH)
    2614 2613   {
    2615 2614   if (((shared->mailbox->type != MUTT_MH) && (shared->mailbox->type != MUTT_MAILDIR)) ||
    skipped 2 lines
    2618 2617   mutt_message(_("No virtual folder and no Message-Id, aborting"));
    2619 2618   return FR_ERROR;
    2620 2619   } // no virtual folder, but we have message-id, reconstruct thread on-the-fly
     2620 + char buf[PATH_MAX] = { 0 };
    2621 2621   strncpy(buf, "id:", sizeof(buf));
    2622 2622   int msg_id_offset = 0;
    2623 2623   if ((shared->email->env->message_id)[0] == '<')
    skipped 400 lines
  • ■ ■ ■ ■ ■
    main.c
    skipped 811 lines
    812 812   if (!cli_nntp)
    813 813   cli_nntp = mutt_str_getenv("NNTPSERVER");
    814 814   
    815  - char buf[1024] = { 0 };
    816 815   if (!cli_nntp)
     816 + {
     817 + char buf[1024] = { 0 };
    817 818   cli_nntp = mutt_file_read_keyword(SYSCONFDIR "/nntpserver", buf, sizeof(buf));
     819 + }
    818 820   
    819 821   if (cli_nntp)
    820 822   {
    skipped 608 lines
  • ■ ■ ■ ■ ■ ■
    mixmaster/win_chain.c
    skipped 422 lines
    423 423   if (cd->chain_len == 0)
    424 424   return false;
    425 425   
    426  - if (cd->chain_len != 0)
     426 + int last_index = cd->chain[cd->chain_len - 1];
     427 + if (last_index != 0)
    427 428   {
    428  - int last_index = cd->chain[cd->chain_len - 1];
    429  - if (last_index != 0)
     429 + struct Remailer **rp = ARRAY_GET(cd->ra, last_index);
     430 + if ((*rp)->caps & MIX_CAP_MIDDLEMAN)
    430 431   {
    431  - struct Remailer **rp = ARRAY_GET(cd->ra, last_index);
    432  - if ((*rp)->caps & MIX_CAP_MIDDLEMAN)
    433  - {
    434  - mutt_error(_("Error: %s can't be used as the final remailer of a chain"),
    435  - (*rp)->shortname);
    436  - return false;
    437  - }
     432 + mutt_error(_("Error: %s can't be used as the final remailer of a chain"),
     433 + (*rp)->shortname);
     434 + return false;
    438 435   }
    439 436   }
    440 437   
    skipped 3 lines
  • ■ ■ ■ ■ ■ ■
    mixmaster/win_hosts.c
    skipped 226 lines
    227 227   */
    228 228  struct Remailer *win_hosts_get_selection(struct MuttWindow *win)
    229 229  {
    230  - if (!win)
    231  - return NULL;
    232  - 
    233 230   if (!win || !win->wdata)
    234 231   return NULL;
    235 232   
    skipped 17 lines
  • ■ ■ ■ ■
    mutt/charset.c
    skipped 727 lines
    728 728   char *saved_out = out;
    729 729   
    730 730   const size_t convlen = iconv(cd, (ICONV_CONST char **) &s, &slen, &out, &outlen);
    731  - if (convlen == -1)
     731 + if (convlen == (size_t) -1)
    732 732   rc = errno;
    733 733   
    734 734   FREE(&saved_out);
    skipped 362 lines
  • ■ ■ ■ ■ ■ ■
    mutt/date.c
    skipped 123 lines
    124 124   * returns the seconds east of UTC given 'g' and its corresponding gmtime()
    125 125   * representation
    126 126   */
    127  -static time_t compute_tz(time_t g, struct tm *utc)
     127 +static int compute_tz(time_t g, struct tm *utc)
    128 128  {
    129 129   struct tm lt = mutt_date_localtime(g);
    130 130   
    131  - time_t t = (((lt.tm_hour - utc->tm_hour) * 60) + (lt.tm_min - utc->tm_min)) * 60;
     131 + int tz = (((lt.tm_hour - utc->tm_hour) * 60) + (lt.tm_min - utc->tm_min)) * 60;
    132 132   
    133 133   int yday = (lt.tm_yday - utc->tm_yday);
    134 134   if (yday != 0)
    skipped 2 lines
    137 137   if ((yday == -1) || /* UTC passed midnight before localtime */
    138 138   (yday > 1)) /* UTC passed new year before localtime */
    139 139   {
    140  - t -= (24 * 60 * 60);
     140 + tz -= (24 * 60 * 60);
    141 141   }
    142 142   else
    143 143   {
    144  - t += (24 * 60 * 60);
     144 + tz += (24 * 60 * 60);
    145 145   }
    146 146   }
    147 147   
    148  - return t;
     148 + return tz;
    149 149  }
    150 150   
    151 151  /**
    skipped 51 lines
    203 203   * Returns the local timezone in seconds east of UTC for the time t,
    204 204   * or for the current time if t is zero.
    205 205   */
    206  -time_t mutt_date_local_tz(time_t t)
     206 +int mutt_date_local_tz(time_t t)
    207 207  {
    208 208   /* Check we haven't overflowed the time (on 32-bit arches) */
    209 209   if ((t == TIME_T_MAX) || (t == TIME_T_MIN))
    skipped 42 lines
    252 252   return TIME_T_MAX;
    253 253   
    254 254   /* Compute the number of days since January 1 in the same year */
    255  - time_t g = AccumDaysPerMonth[t->tm_mon % mutt_array_size(Months)];
     255 + int yday = AccumDaysPerMonth[t->tm_mon % mutt_array_size(Months)];
    256 256   
    257 257   /* The leap years are 1972 and every 4. year until 2096,
    258 258   * but this algorithm will fail after year 2099 */
    259  - g += t->tm_mday;
     259 + yday += t->tm_mday;
    260 260   if ((t->tm_year % 4) || (t->tm_mon < 2))
    261  - g--;
    262  - t->tm_yday = g;
     261 + yday--;
     262 + t->tm_yday = yday;
     263 + 
     264 + time_t g = yday;
    263 265   
    264 266   /* Compute the number of days since January 1, 1970 */
    265 267   g += (t->tm_year - 70) * (time_t) 365;
    skipped 115 lines
    381 383   return;
    382 384   
    383 385   struct tm tm;
    384  - time_t tz = 0;
     386 + int tz = 0;
    385 387   
    386 388   time_t t = mutt_date_epoch();
    387 389   if (local)
    skipped 8 lines
    396 398   
    397 399   tz /= 60;
    398 400   
    399  - mutt_buffer_add_printf(buf, "%s, %d %s %d %02d:%02d:%02d %+03d%02d",
    400  - Weekdays[tm.tm_wday], tm.tm_mday, Months[tm.tm_mon],
    401  - tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec,
    402  - (int) tz / 60, (int) abs((int) tz) % 60);
     401 + mutt_buffer_add_printf(buf, "%s, %d %s %d %02d:%02d:%02d %+03d%02d", Weekdays[tm.tm_wday],
     402 + tm.tm_mday, Months[tm.tm_mon], tm.tm_year + 1900,
     403 + tm.tm_hour, tm.tm_min, tm.tm_sec, tz / 60, abs(tz) % 60);
    403 404  }
    404 405   
    405 406  /**
    skipped 154 lines
    560 561   return -1;
    561 562   
    562 563   struct tm tm = mutt_date_localtime(timestamp);
    563  - time_t tz = mutt_date_local_tz(timestamp);
     564 + int tz = mutt_date_local_tz(timestamp);
    564 565   
    565 566   tz /= 60;
    566 567   
    567 568   return snprintf(buf, buflen, "%02d-%s-%d %02d:%02d:%02d %+03d%02d",
    568 569   tm.tm_mday, Months[tm.tm_mon], tm.tm_year + 1900, tm.tm_hour,
    569  - tm.tm_min, tm.tm_sec, (int) tz / 60, (int) abs((int) tz) % 60);
     570 + tm.tm_min, tm.tm_sec, tz / 60, abs(tz) % 60);
    570 571  }
    571 572   
    572 573  /**
    skipped 140 lines
  • ■ ■ ■ ■
    mutt/date.h
    skipped 55 lines
    56 56  struct tm mutt_date_gmtime(time_t t);
    57 57  size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t);
    58 58  struct tm mutt_date_localtime(time_t t);
    59  -time_t mutt_date_local_tz(time_t t);
     59 +int mutt_date_local_tz(time_t t);
    60 60  void mutt_date_make_date(struct Buffer *buf, bool local);
    61 61  int mutt_date_make_imap(char *buf, size_t buflen, time_t timestamp);
    62 62  time_t mutt_date_make_time(struct tm *t, bool local);
    skipped 8 lines
  • ■ ■ ■ ■
    mutt/prex.c
    skipped 267 lines
    268 268   // clang-format on
    269 269   };
    270 270   
    271  - assert((which >= 0) && (which < PREX_MAX) && "Invalid 'which' argument");
     271 + assert((which < PREX_MAX) && "Invalid 'which' argument");
    272 272   struct PrexStorage *h = &storage[which];
    273 273   assert((which == h->which) && "Fix 'storage' array");
    274 274   if (!h->re)
    skipped 87 lines
  • ■ ■ ■ ■
    mx.c
    skipped 1529 lines
    1530 1530  /**
    1531 1531   * mx_path_parent - Find the parent of a mailbox path - Wrapper for MxOps::path_parent()
    1532 1532   */
    1533  -int mx_path_parent(char *buf, size_t buflen)
     1533 +int mx_path_parent(const char *buf, size_t buflen)
    1534 1534  {
    1535 1535   if (!buf)
    1536 1536   return -1;
    skipped 338 lines
  • ■ ■ ■ ■
    mx.h
    skipped 56 lines
    57 57  int mx_save_hcache (struct Mailbox *m, struct Email *e);
    58 58  int mx_path_canon (char *buf, size_t buflen, const char *folder, enum MailboxType *type);
    59 59  int mx_path_canon2 (struct Mailbox *m, const char *folder);
    60  -int mx_path_parent (char *buf, size_t buflen);
     60 +int mx_path_parent (const char *buf, size_t buflen);
    61 61  int mx_path_pretty (char *buf, size_t buflen, const char *folder);
    62 62  enum MailboxType mx_path_probe (const char *path);
    63 63  struct Mailbox *mx_path_resolve (const char *path);
    skipped 22 lines
  • ■ ■ ■ ■ ■ ■
    ncrypt/gpgme_functions.c
    skipped 509 lines
    510 510   if (key->issuer_serial)
    511 511   {
    512 512   s = key->issuer_serial;
    513  - if (s)
    514  - {
    515  - fprintf(fp, "%*s0x%s\n", KeyInfoPadding[KIP_SERIAL_NO],
    516  - _(KeyInfoPrompts[KIP_SERIAL_NO]), s);
    517  - }
     513 + fprintf(fp, "%*s0x%s\n", KeyInfoPadding[KIP_SERIAL_NO],
     514 + _(KeyInfoPrompts[KIP_SERIAL_NO]), s);
    518 515   }
    519 516   
    520 517   if (key->issuer_name)
    521 518   {
    522 519   s = key->issuer_name;
    523  - if (s)
    524  - {
    525  - fprintf(fp, "%*s", KeyInfoPadding[KIP_ISSUED_BY], _(KeyInfoPrompts[KIP_ISSUED_BY]));
    526  - parse_and_print_user_id(fp, s);
    527  - putc('\n', fp);
    528  - }
     520 + fprintf(fp, "%*s", KeyInfoPadding[KIP_ISSUED_BY], _(KeyInfoPrompts[KIP_ISSUED_BY]));
     521 + parse_and_print_user_id(fp, s);
     522 + putc('\n', fp);
    529 523   }
    530 524   
    531 525   /* For PGP we list all subkeys. */
    skipped 332 lines
  • ■ ■ ■ ■ ■ ■
    nntp/nntp.c
    skipped 1194 lines
    1195 1195   }
    1196 1196   if (rc == 0)
    1197 1197   {
    1198  - for (current = first; (current <= last) && (rc == 0); current++)
     1198 + for (current = first; (current <= last); current++)
    1199 1199   {
    1200 1200   if (fc.messages[current - first])
    1201 1201   continue;
    skipped 265 lines
    1467 1467   m->msg_count = 0;
    1468 1468   m->msg_tagged = 0;
    1469 1469   
    1470  - if (mdata->last_message < mdata->last_loaded)
    1471  - {
    1472  - mdata->last_loaded = mdata->first_message - 1;
    1473  - const long c_nntp_context = cs_subset_long(NeoMutt->sub, "nntp_context");
    1474  - if (c_nntp_context && (mdata->last_message - mdata->last_loaded > c_nntp_context))
    1475  - mdata->last_loaded = mdata->last_message - c_nntp_context;
    1476  - }
     1470 + mdata->last_loaded = mdata->first_message - 1;
     1471 + const long c_nntp_context = cs_subset_long(NeoMutt->sub, "nntp_context");
     1472 + if (c_nntp_context && (mdata->last_message - mdata->last_loaded > c_nntp_context))
     1473 + mdata->last_loaded = mdata->last_message - c_nntp_context;
     1474 + 
    1477 1475   rc = MX_STATUS_REOPENED;
    1478 1476   }
    1479 1477   
    skipped 1291 lines
  • ■ ■ ■ ■
    pager/display.c
    skipped 306 lines
    307 307   * Checks if line matches the `$quote_regex` and doesn't match `$smileys`.
    308 308   * This is used by the pager for calling qstyle_classify.
    309 309   */
    310  -int mutt_is_quote_line(char *line, regmatch_t *pmatch)
     310 +bool mutt_is_quote_line(char *line, regmatch_t *pmatch)
    311 311  {
    312 312   bool is_quote = false;
    313 313   const struct Regex *c_smileys = cs_subset_regex(NeoMutt->sub, "smileys");
    skipped 959 lines
  • ■ ■ ■ ■
    pager/lib.h
    skipped 198 lines
    199 199  int mutt_display_message(struct MuttWindow *win_index, struct IndexSharedData *shared);
    200 200  int external_pager(struct Mailbox *m, struct Email *e, const char *command);
    201 201  void pager_queue_redraw(struct PagerPrivateData *priv, PagerRedrawFlags redraw);
    202  -int mutt_is_quote_line(char *buf, regmatch_t *pmatch);
     202 +bool mutt_is_quote_line(char *buf, regmatch_t *pmatch);
    203 203   
    204 204  void mutt_clear_pager_position(void);
    205 205   
    skipped 8 lines
  • ■ ■ ■ ■ ■ ■
    pager/pager.c
    skipped 314 lines
    315 315   return 0;
    316 316   
    317 317   struct MuttWindow *win_pager = nc->global_data;
    318  - if (!win_pager)
    319  - return 0;
    320 318   
    321 319   struct PagerPrivateData *priv = win_pager->wdata;
    322 320   if (!priv)
    skipped 128 lines
  • ■ ■ ■ ■ ■ ■
    pager/pbar.c
    skipped 242 lines
    243 243   return -1;
    244 244   
    245 245   struct MuttWindow *win_pbar = nc->global_data;
    246  - if (!win_pbar)
    247  - return 0;
    248 246   
    249 247   if (nc->event_subtype & NT_PAGER_VIEW)
    250 248   {
    skipped 99 lines
  • ■ ■ ■ ■ ■ ■
    pattern/compile.c
    skipped 849 lines
    850 850  {
    851 851   if (pat->min <= pat->max)
    852 852   return;
    853  - int num = pat->min;
     853 + long num = pat->min;
    854 854   pat->min = pat->max;
    855 855   pat->max = num;
    856 856  }
    skipped 36 lines
    893 893   /* Snarf the contents of the two sides of the range. */
    894 894   pat->min = scan_range_slot(s, pmatch, pspec->lgrp, RANGE_S_LEFT, kind, m, menu);
    895 895   pat->max = scan_range_slot(s, pmatch, pspec->rgrp, RANGE_S_RIGHT, kind, m, menu);
    896  - mutt_debug(LL_DEBUG1, "pat->min=%d pat->max=%d\n", pat->min, pat->max);
     896 + mutt_debug(LL_DEBUG1, "pat->min=%ld pat->max=%ld\n", pat->min, pat->max);
    897 897   
    898 898   /* Special case for a bare 0. */
    899 899   if ((kind == RANGE_K_BARE) && (pat->min == 0) && (pat->max == 0))
    skipped 508 lines
  • ■ ■ ■ ■ ■ ■
    pattern/exec.c
    skipped 431 lines
    432 432   *
    433 433   * Test the 'To' and 'Cc' fields of an Address using a test function (the predicate).
    434 434   */
    435  -static int mutt_is_predicate_recipient(bool all_addr, struct Envelope *env, addr_predicate_t p)
     435 +static bool mutt_is_predicate_recipient(bool all_addr, struct Envelope *env, addr_predicate_t p)
    436 436  {
    437 437   struct AddressList *als[] = { &env->to, &env->cc };
    438 438   for (size_t i = 0; i < mutt_array_size(als); ++i)
    skipped 17 lines
    456 456   * - One Address is subscribed (all_addr is false)
    457 457   * - All the Addresses are subscribed (all_addr is true)
    458 458   */
    459  -int mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env)
     459 +bool mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env)
    460 460  {
    461 461   return mutt_is_predicate_recipient(all_addr, env, &mutt_is_subscribed_list);
    462 462  }
    skipped 6 lines
    469 469   * - One Address is a mailing list (all_addr is false)
    470 470   * - All the Addresses are mailing lists (all_addr is true)
    471 471   */
    472  -int mutt_is_list_recipient(bool all_addr, struct Envelope *env)
     472 +bool mutt_is_list_recipient(bool all_addr, struct Envelope *env)
    473 473  {
    474 474   return mutt_is_predicate_recipient(all_addr, env, &mutt_is_mail_list);
    475 475  }
    skipped 185 lines
    661 661   * @retval 1 The cache value is set and has a true value
    662 662   * @retval 0 otherwise (even if unset!)
    663 663   */
    664  -static int get_pattern_cache_value(int cache_entry)
     664 +static bool get_pattern_cache_value(int cache_entry)
    665 665  {
    666 666   return cache_entry == 2;
    667 667  }
    skipped 273 lines
    941 941   if (!e->env)
    942 942   return false;
    943 943   
    944  - int result;
     944 + bool result;
    945 945   if (cache)
    946 946   {
    947 947   int *cache_entry = pat->all_addr ? &cache->list_all : &cache->list_one;
    skipped 13 lines
    961 961   if (!e->env)
    962 962   return false;
    963 963   
    964  - int result;
     964 + bool result;
    965 965   if (cache)
    966 966   {
    967 967   int *cache_entry = pat->all_addr ? &cache->sub_all : &cache->sub_one;
    skipped 13 lines
    981 981   if (!e->env)
    982 982   return false;
    983 983   
    984  - int result;
     984 + bool result;
    985 985   if (cache)
    986 986   {
    987 987   int *cache_entry = pat->all_addr ? &cache->pers_recip_all : &cache->pers_recip_one;
    skipped 13 lines
    1001 1001   if (!e->env)
    1002 1002   return false;
    1003 1003   
    1004  - int result;
     1004 + bool result;
    1005 1005   if (cache)
    1006 1006   {
    1007 1007   int *cache_entry = pat->all_addr ? &cache->pers_from_all : &cache->pers_from_one;
    skipped 153 lines
  • ■ ■ ■ ■ ■ ■
    pattern/lib.h
    skipped 77 lines
    78 78   bool dynamic : 1; ///< Evaluate date ranges at run time
    79 79   bool sendmode : 1; ///< Evaluate searches in send-mode
    80 80   bool is_multi : 1; ///< Multiple case (only for ~I pattern now)
    81  - int min; ///< Minimum for range checks
    82  - int max; ///< Maximum for range checks
     81 + long min; ///< Minimum for range checks
     82 + long max; ///< Maximum for range checks
    83 83   struct PatternList *child; ///< Arguments to logical operation
    84 84   union {
    85 85   regex_t *regex; ///< Compiled regex, for non-pattern matching
    skipped 99 lines
    185 185  bool dlg_select_pattern(char *buf, size_t buflen);
    186 186   
    187 187  int mutt_which_case(const char *s);
    188  -int mutt_is_list_recipient(bool all_addr, struct Envelope *env);
    189  -int mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env);
     188 +bool mutt_is_list_recipient(bool all_addr, struct Envelope *env);
     189 +bool mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env);
    190 190  int mutt_pattern_func(struct MailboxView *mv, int op, char *prompt);
    191 191  int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, struct Menu *menu);
    192 192  int mutt_search_command(struct Mailbox *m, struct Menu *menu, int cur, int op);
    skipped 6 lines
  • ■ ■ ■ ■ ■ ■
    test/pattern/comp.c
    skipped 104 lines
    105 105   p += sprintf(p, "%d,", e->ign_case);
    106 106   p += sprintf(p, "%d,", e->is_alias);
    107 107   p += sprintf(p, "%d,", e->is_multi);
    108  - p += sprintf(p, "%d,", e->min);
    109  - p += sprintf(p, "%d,", e->max);
     108 + p += sprintf(p, "%ld,", e->min);
     109 + p += sprintf(p, "%ld,", e->max);
    110 110   p += sprintf(p, "\"%s\",", e->p.str ? e->p.str : "");
    111 111   p += sprintf(p, "%s,", !e->child ? "(null)" : "(list)");
    112 112   p += sprintf(p, "%s", SLIST_NEXT(e, entries) ? "(next)" : "(null)");
    skipped 664 lines
Please wait...
Page is in error, reload to recover