mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
Use appendPQExpBufferStr where approrpriate
This commit is contained in:
@@ -24,7 +24,7 @@ static bool _local_command(const char *command, PQExpBufferData *outputbuf, bool
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute a command locally. "outputbuf" should either be an
|
* Execute a command locally. "outputbuf" should either be an
|
||||||
* initialised PQexpbuffer, or NULL
|
* initialised PQExpPuffer, or NULL
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
local_command(const char *command, PQExpBufferData *outputbuf)
|
local_command(const char *command, PQExpBufferData *outputbuf)
|
||||||
@@ -77,7 +77,7 @@ _local_command(const char *command, PQExpBufferData *outputbuf, bool simple, int
|
|||||||
|
|
||||||
while (fgets(output, MAXLEN, fp) != NULL)
|
while (fgets(output, MAXLEN, fp) != NULL)
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(outputbuf, "%s", output);
|
appendPQExpBufferStr(outputbuf, output);
|
||||||
|
|
||||||
if (!feof(fp) && simple == false)
|
if (!feof(fp) && simple == false)
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@ remote_command(const char *host, const char *user, const char *command, const ch
|
|||||||
appendPQExpBuffer(&ssh_host, "%s@", user);
|
appendPQExpBuffer(&ssh_host, "%s@", user);
|
||||||
}
|
}
|
||||||
|
|
||||||
appendPQExpBuffer(&ssh_host, "%s", host);
|
appendPQExpBufferStr(&ssh_host, host);
|
||||||
|
|
||||||
maxlen_snprintf(ssh_command,
|
maxlen_snprintf(ssh_command,
|
||||||
"ssh -o Batchmode=yes %s %s %s",
|
"ssh -o Batchmode=yes %s %s %s",
|
||||||
@@ -150,7 +150,7 @@ remote_command(const char *host, const char *user, const char *command, const ch
|
|||||||
/* TODO: better error handling */
|
/* TODO: better error handling */
|
||||||
while (fgets(output, MAXLEN, fp) != NULL)
|
while (fgets(output, MAXLEN, fp) != NULL)
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(outputbuf, "%s", output);
|
appendPQExpBufferStr(outputbuf, output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user