diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2011-12-27 21:19:09 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2011-12-27 21:19:09 +0200 |
| commit | 037a82704ce644e2b1c3946345b54444caddb1a5 (patch) | |
| tree | d89abc55ac119b86d69c01f819ab8fb22a1382c6 /src/interfaces/ecpg/preproc/descriptor.c | |
| parent | d383c23f6fbc4a79dae66483cf4f7051121008ad (diff) | |
| download | postgresql-037a82704ce644e2b1c3946345b54444caddb1a5.tar.gz | |
Standardize treatment of strcmp() return value
Always compare the return value to 0, don't use cute tricks like
if (!strcmp(...)).
Diffstat (limited to 'src/interfaces/ecpg/preproc/descriptor.c')
| -rw-r--r-- | src/interfaces/ecpg/preproc/descriptor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index 965963de7e..52865293f2 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -106,11 +106,11 @@ drop_descriptor(char *name, char *connection) for (i = descriptors; i; lastptr = &i->next, i = i->next) { - if (!strcmp(name, i->name)) + if (strcmp(name, i->name) == 0) { if ((!connection && !i->connection) || (connection && i->connection - && !strcmp(connection, i->connection))) + && strcmp(connection, i->connection) == 0)) { *lastptr = i->next; if (i->connection) @@ -135,11 +135,11 @@ lookup_descriptor(char *name, char *connection) for (i = descriptors; i; i = i->next) { - if (!strcmp(name, i->name)) + if (strcmp(name, i->name) == 0) { if ((!connection && !i->connection) || (connection && i->connection - && !strcmp(connection, i->connection))) + && strcmp(connection, i->connection) == 0)) return i; } } |
