mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Fix a couple of rather-pointless-but-easily-fixed Coverity warnings.
Per Martijn van Oosterhout.
This commit is contained in:
parent
e37a649e94
commit
3224f2ee25
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.126 2006/04/12 22:18:48 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.127 2006/04/19 16:02:17 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2203,7 +2203,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
|
|||||||
PQExpBuffer qry;
|
PQExpBuffer qry;
|
||||||
|
|
||||||
if (!schemaName || *schemaName == '\0' ||
|
if (!schemaName || *schemaName == '\0' ||
|
||||||
strcmp(AH->currSchema, schemaName) == 0)
|
(AH->currSchema && strcmp(AH->currSchema, schemaName) == 0))
|
||||||
return; /* no need to do anything */
|
return; /* no need to do anything */
|
||||||
|
|
||||||
qry = createPQExpBuffer();
|
qry = createPQExpBuffer();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.43 2006/03/05 15:58:52 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.44 2006/04/19 16:02:17 tgl Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#include "prompt.h"
|
#include "prompt.h"
|
||||||
@ -250,13 +250,12 @@ get_prompt(promptStatus_t status)
|
|||||||
/* execute command */
|
/* execute command */
|
||||||
case '`':
|
case '`':
|
||||||
{
|
{
|
||||||
FILE *fd = NULL;
|
FILE *fd;
|
||||||
char *file = pg_strdup(p + 1);
|
char *file = pg_strdup(p + 1);
|
||||||
int cmdend;
|
int cmdend;
|
||||||
|
|
||||||
cmdend = strcspn(file, "`");
|
cmdend = strcspn(file, "`");
|
||||||
file[cmdend] = '\0';
|
file[cmdend] = '\0';
|
||||||
if (file)
|
|
||||||
fd = popen(file, "r");
|
fd = popen(file, "r");
|
||||||
if (fd)
|
if (fd)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user