]> granicus.if.org Git - neomutt/commitdiff
comparison ordering
authorRichard Russon <rich@flatcap.org>
Wed, 17 Jan 2018 18:41:30 +0000 (18:41 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 18 Jan 2018 23:32:12 +0000 (23:32 +0000)
conn/ssl.c
hcache/hcache.c
help.c
mbox.c
ncrypt/crypt_gpgme.c
recvattach.c

index 05fcb04630f5d5d291178eff077f158a6d7c1fde..9d720a47110914e478e3eff995d265d695100706 100644 (file)
@@ -185,7 +185,7 @@ static int ssl_set_verify_partial(SSL_CTX *ctx)
     if (param)
     {
       X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_PARTIAL_CHAIN);
-      if (0 == SSL_CTX_set1_param(ctx, param))
+      if (SSL_CTX_set1_param(ctx, param) == 0)
       {
         mutt_debug(2, "SSL_CTX_set1_param() failed.\n");
         rc = -1;
index 4f95954144bc4b37779a2aec47df47c61ff63622..321d9e03dbbc0dfe7e910c0d566e6297e2b1267c 100644 (file)
@@ -487,7 +487,7 @@ static void restore_envelope(struct Envelope *e, const unsigned char *d, int *of
   restore_char(&e->subject, d, off, convert);
   restore_int((unsigned int *) (&real_subj_off), d, off);
 
-  if (0 <= real_subj_off)
+  if (real_subj_off >= 0)
     e->real_subj = e->subject + real_subj_off;
   else
     e->real_subj = NULL;
diff --git a/help.c b/help.c
index 8491920d70498aef0ee816eaa9fd78244be67c6b..159b3e83cc30c79628dd90d00abbebb96d18b6a4 100644 (file)
--- a/help.c
+++ b/help.c
@@ -140,7 +140,7 @@ static int print_macro(FILE *f, int maxwidth, const char **macro)
     }
     else if (wc < 0x20 || wc == 0x7f)
     {
-      if (2 > n)
+      if (n < 2)
         break;
       n -= 2;
       if (wc == '\033')
@@ -156,7 +156,7 @@ static int print_macro(FILE *f, int maxwidth, const char **macro)
     }
     else
     {
-      if (1 > n)
+      if (n < 1)
         break;
       n -= 1;
       fprintf(f, "?");
diff --git a/mbox.c b/mbox.c
index c48df80a51a366ab48e083cfb34cc4bce5934bdf..dc6eabc2c97ac00298777c1780e04a3d1fd23384 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -181,7 +181,7 @@ static int mmdf_parse_mailbox(struct Context *ctx)
       {
         tmploc = loc + hdr->content->length;
 
-        if (0 < tmploc && tmploc < ctx->size)
+        if ((tmploc > 0) && (tmploc < ctx->size))
         {
           if (fseeko(ctx->fp, tmploc, SEEK_SET) != 0 ||
               fgets(buf, sizeof(buf) - 1, ctx->fp) == NULL ||
@@ -329,7 +329,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
         loc = ftello(ctx->fp);
         tmploc = loc + curhdr->content->length + 1;
 
-        if (0 < tmploc && tmploc < ctx->size)
+        if ((tmploc > 0) && (tmploc < ctx->size))
         {
           /*
            * check to see if the content-length looks valid.  we expect to
index 3cad2bd3a7d5d3a9d677bf92bcd113eb37b50656..47f256fd9a46f0d170eafca8fcb39461d1e01ad4 100644 (file)
@@ -5081,8 +5081,8 @@ static int verify_sender(struct Header *h)
       for (uid = key->uids; uid && rc; uid = uid->next)
       {
         uid_length = strlen(uid->email);
-        if (1 && (uid->email[0] == '<') && (uid->email[uid_length - 1] == '>') &&
-            (uid_length == sender_length + 2))
+        if ((uid->email[0] == '<') && (uid->email[uid_length - 1] == '>') &&
+            (uid_length == (sender_length + 2)))
         {
           const char *at_sign = strchr(uid->email + 1, '@');
           if (!at_sign)
index 77b45debc27e97d99891abde565563620b23efc2..352c9982813e35c7a78ad34217cc9f25aac9772f 100644 (file)
@@ -105,7 +105,7 @@ void mutt_update_tree(struct AttachCtx *actx)
   {
     rindex = actx->v2r[vindex];
     actx->idx[rindex]->num = vindex;
-    if (2 * (actx->idx[rindex]->level + 2) < sizeof(buf))
+    if ((2 * (actx->idx[rindex]->level + 2)) < sizeof(buf))
     {
       if (actx->idx[rindex]->level)
       {
@@ -127,7 +127,7 @@ void mutt_update_tree(struct AttachCtx *actx)
     else
       actx->idx[rindex]->tree = mutt_str_strdup(buf);
 
-    if (2 * (actx->idx[rindex]->level + 2) < sizeof(buf) && actx->idx[rindex]->level)
+    if ((2 * (actx->idx[rindex]->level + 2)) < sizeof(buf) && actx->idx[rindex]->level)
     {
       s = buf + 2 * (actx->idx[rindex]->level - 1);
       *s++ = (actx->idx[rindex]->content->next) ? '\005' : '\006';