aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2011-12-27 21:19:09 +0200
committerPeter Eisentraut <peter_e@gmx.net>2011-12-27 21:19:09 +0200
commit037a82704ce644e2b1c3946345b54444caddb1a5 (patch)
treed89abc55ac119b86d69c01f819ab8fb22a1382c6 /contrib/pgcrypto
parentd383c23f6fbc4a79dae66483cf4f7051121008ad (diff)
downloadpostgresql-037a82704ce644e2b1c3946345b54444caddb1a5.tar.gz
postgresql-037a82704ce644e2b1c3946345b54444caddb1a5.zip
Standardize treatment of strcmp() return value
Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
Diffstat (limited to 'contrib/pgcrypto')
-rw-r--r--contrib/pgcrypto/crypt-md5.c2
-rw-r--r--contrib/pgcrypto/internal.c2
-rw-r--r--contrib/pgcrypto/openssl.c2
-rw-r--r--contrib/pgcrypto/px-crypt.c2
-rw-r--r--contrib/pgcrypto/px.c6
5 files changed, 7 insertions, 7 deletions
diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c
index 2215f38d8bf..7aa57bc319f 100644
--- a/contrib/pgcrypto/crypt-md5.c
+++ b/contrib/pgcrypto/crypt-md5.c
@@ -55,7 +55,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
sp = salt;
/* If it starts with the magic string, then skip that */
- if (!strncmp(sp, magic, strlen(magic)))
+ if (strncmp(sp, magic, strlen(magic)) == 0)
sp += strlen(magic);
/* It stops at the first '$', max 8 chars */
diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c
index 5ceb5271bbb..a02c943e049 100644
--- a/contrib/pgcrypto/internal.c
+++ b/contrib/pgcrypto/internal.c
@@ -603,7 +603,7 @@ px_find_cipher(const char *name, PX_Cipher **res)
name = px_resolve_alias(int_aliases, name);
for (i = 0; int_ciphers[i].name; i++)
- if (!strcmp(int_ciphers[i].name, name))
+ if (strcmp(int_ciphers[i].name, name) == 0)
{
c = int_ciphers[i].load();
break;
diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c
index dc25acea5d2..ad7fb9ee0ee 100644
--- a/contrib/pgcrypto/openssl.c
+++ b/contrib/pgcrypto/openssl.c
@@ -953,7 +953,7 @@ px_find_cipher(const char *name, PX_Cipher **res)
name = px_resolve_alias(ossl_aliases, name);
for (i = ossl_cipher_types; i->name; i++)
- if (!strcmp(i->name, name))
+ if (strcmp(i->name, name) == 0)
break;
if (i->name == NULL)
return PXE_NO_CIPHER;
diff --git a/contrib/pgcrypto/px-crypt.c b/contrib/pgcrypto/px-crypt.c
index d2e1682e159..63ec038dc54 100644
--- a/contrib/pgcrypto/px-crypt.c
+++ b/contrib/pgcrypto/px-crypt.c
@@ -96,7 +96,7 @@ px_crypt(const char *psw, const char *salt, char *buf, unsigned len)
{
if (!c->id_len)
break;
- if (!strncmp(salt, c->id, c->id_len))
+ if (strncmp(salt, c->id, c->id_len) == 0)
break;
}
diff --git a/contrib/pgcrypto/px.c b/contrib/pgcrypto/px.c
index e3f5e262215..f23d4de5738 100644
--- a/contrib/pgcrypto/px.c
+++ b/contrib/pgcrypto/px.c
@@ -360,7 +360,7 @@ parse_cipher_name(char *full, char **cipher, char **pad)
if (p2 != NULL)
{
*p2++ = 0;
- if (!strcmp(p, "pad"))
+ if (strcmp(p, "pad") == 0)
*pad = p2;
else
return PXE_BAD_OPTION;
@@ -405,9 +405,9 @@ px_find_combo(const char *name, PX_Combo **res)
if (s_pad != NULL)
{
- if (!strcmp(s_pad, "pkcs"))
+ if (strcmp(s_pad, "pkcs") == 0)
cx->padding = 1;
- else if (!strcmp(s_pad, "none"))
+ else if (strcmp(s_pad, "none") == 0)
cx->padding = 0;
else
goto err1;