Skip to content

Commit 3224f2e

Browse files
committed
Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.
Per Martijn van Oosterhout.
1 parent e37a649 commit 3224f2e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.126 2006/04/12 22:18:48 tgl Exp $
18+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.127 2006/04/19 16:02:17 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2203,7 +2203,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
22032203
PQExpBuffer qry;
22042204

22052205
if (!schemaName || *schemaName == '\0' ||
2206-
strcmp(AH->currSchema, schemaName) == 0)
2206+
(AH->currSchema && strcmp(AH->currSchema, schemaName) == 0))
22072207
return; /* no need to do anything */
22082208

22092209
qry = createPQExpBuffer();

src/bin/psql/prompt.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.43 2006/03/05 15:58:52 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.44 2006/04/19 16:02:17 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "prompt.h"
@@ -250,14 +250,13 @@ get_prompt(promptStatus_t status)
250250
/* execute command */
251251
case '`':
252252
{
253-
FILE *fd = NULL;
253+
FILE *fd;
254254
char *file = pg_strdup(p + 1);
255255
int cmdend;
256256

257257
cmdend = strcspn(file, "`");
258258
file[cmdend] = '\0';
259-
if (file)
260-
fd = popen(file, "r");
259+
fd = popen(file, "r");
261260
if (fd)
262261
{
263262
fgets(buf, MAX_PROMPT_SIZE - 1, fd);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy