diff options
Diffstat (limited to 'src/bin/pg_ctl/pg_ctl.c')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 8113e507cbf..9045e00a1db 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -285,7 +285,7 @@ readfile(const char *path) int i; int n; int len; - struct stat statbuf; + struct stat statbuf; /* * Slurp the file into memory. @@ -344,8 +344,9 @@ readfile(const char *path) { if (buffer[i] == '\n') { - int slen = &buffer[i] - linebegin + 1; - char *linebuf = pg_malloc(slen + 1); + int slen = &buffer[i] - linebegin + 1; + char *linebuf = pg_malloc(slen + 1); + memcpy(linebuf, linebegin, slen); linebuf[slen] = '\0'; result[n++] = linebuf; @@ -1098,10 +1099,10 @@ do_promote(void) } /* - * For 9.3 onwards, use fast promotion as the default option. - * Promotion with a full checkpoint is still possible by writing - * a file called "promote", e.g. - * snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data); + * For 9.3 onwards, use fast promotion as the default option. Promotion + * with a full checkpoint is still possible by writing a file called + * "promote", e.g. snprintf(promote_file, MAXPGPATH, "%s/promote", + * pg_data); */ snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data); |