diff options
author | Tom Lane | 2006-04-19 16:02:17 +0000 |
---|---|---|
committer | Tom Lane | 2006-04-19 16:02:17 +0000 |
commit | 8a9cb6c0c58062a11c55964038f83259f2b2ed0f (patch) | |
tree | b827ad129d8c37eb8d8b6cc4a263ae271fea549a | |
parent | 03b046aa0596615d299c5bd6a68987672451b04a (diff) |
Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.
Per Martijn van Oosterhout.
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 2 | ||||
-rw-r--r-- | src/bin/psql/prompt.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 0c85af4052..2e885b9607 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2203,7 +2203,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName) PQExpBuffer qry; if (!schemaName || *schemaName == '\0' || - strcmp(AH->currSchema, schemaName) == 0) + (AH->currSchema && strcmp(AH->currSchema, schemaName) == 0)) return; /* no need to do anything */ qry = createPQExpBuffer(); diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 49f7102fd5..0ec573d173 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -250,14 +250,13 @@ get_prompt(promptStatus_t status) /* execute command */ case '`': { - FILE *fd = NULL; + FILE *fd; char *file = pg_strdup(p + 1); int cmdend; cmdend = strcspn(file, "`"); file[cmdend] = '\0'; - if (file) - fd = popen(file, "r"); + fd = popen(file, "r"); if (fd) { fgets(buf, MAX_PROMPT_SIZE - 1, fd); |