diff options
Diffstat (limited to 'src/bin/pg_ctl/pg_ctl.c')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 5e430047c35..61557814570 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -4,7 +4,7 @@ * * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.77 2007/02/01 19:10:28 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.78 2007/02/10 14:58:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -416,7 +416,7 @@ test_postmaster_connection(void) /* advance past whitespace/quoting */ while (isspace((unsigned char) *p) || *p == '\'' || *p == '"') p++; - StrNCpy(portstr, p, Min(strcspn(p, "\"'" WHITESPACE) + 1, + strlcpy(portstr, p, Min(strcspn(p, "\"'" WHITESPACE) + 1, sizeof(portstr))); /* keep looking, maybe there is another -p */ } @@ -449,7 +449,7 @@ test_postmaster_connection(void) p++; while (isspace((unsigned char) *p)) p++; - StrNCpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1, + strlcpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1, sizeof(portstr))); /* keep looking, maybe there is another */ } @@ -458,7 +458,7 @@ test_postmaster_connection(void) /* environment */ if (!*portstr && getenv("PGPORT") != NULL) - StrNCpy(portstr, getenv("PGPORT"), sizeof(portstr)); + strlcpy(portstr, getenv("PGPORT"), sizeof(portstr)); /* default */ if (!*portstr) @@ -594,7 +594,7 @@ do_start(void) char full_path[MAXPGPATH]; if (find_my_exec(argv0, full_path) < 0) - StrNCpy(full_path, progname, MAXPGPATH); + strlcpy(full_path, progname, sizeof(full_path)); if (ret == -1) write_stderr(_("The program \"postgres\" is needed by %s " |