Use appendPQExpBufferStr where approrpriate

This commit is contained in:
Ian Barwick
2019-03-01 16:42:00 +09:00
parent 4b89cbd98d
commit 92103c5338

View File

@@ -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