mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
Standardize treatment of strcmp() return value
Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
This commit is contained in:
@ -1464,7 +1464,7 @@ pg_SSPI_recvauth(Port *port)
|
||||
*/
|
||||
if (port->hba->krb_realm && strlen(port->hba->krb_realm))
|
||||
{
|
||||
if (pg_strcasecmp(port->hba->krb_realm, domainname))
|
||||
if (pg_strcasecmp(port->hba->krb_realm, domainname) != 0)
|
||||
{
|
||||
elog(DEBUG2,
|
||||
"SSPI domain (%s) and configured domain (%s) don't match",
|
||||
|
@ -1012,7 +1012,7 @@ index_seq_search(char *str, const KeyWord *kw, const int *index)
|
||||
|
||||
do
|
||||
{
|
||||
if (!strncmp(str, k->name, k->len))
|
||||
if (strncmp(str, k->name, k->len) == 0)
|
||||
return k;
|
||||
k++;
|
||||
if (!k->name)
|
||||
@ -1032,7 +1032,7 @@ suff_search(char *str, KeySuffix *suf, int type)
|
||||
if (s->type != type)
|
||||
continue;
|
||||
|
||||
if (!strncmp(str, s->name, s->len))
|
||||
if (strncmp(str, s->name, s->len) == 0)
|
||||
return s;
|
||||
}
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user