diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/initdb/initdb.c | 4 | ||||
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 10 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 4 | ||||
-rw-r--r-- | src/bin/pg_resetxlog/pg_resetxlog.c | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index ea7b949aa00..5b559aecc95 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -42,7 +42,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.131 2007/02/01 19:10:28 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.132 2007/02/10 14:58:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -2706,7 +2706,7 @@ main(int argc, char *argv[]) char full_path[MAXPGPATH]; if (find_my_exec(argv[0], full_path) < 0) - StrNCpy(full_path, progname, MAXPGPATH); + strlcpy(full_path, progname, sizeof(full_path)); if (ret == -1) fprintf(stderr, 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 " diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index e2e3a9f5bb0..0540969e84b 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.89 2007/01/25 03:30:43 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.90 2007/02/10 14:58:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -150,7 +150,7 @@ main(int argc, char *argv[]) char full_path[MAXPGPATH]; if (find_my_exec(argv[0], full_path) < 0) - StrNCpy(full_path, progname, MAXPGPATH); + strlcpy(full_path, progname, sizeof(full_path)); if (ret == -1) fprintf(stderr, diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index 9705baced7c..1cb7fef0596 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -23,7 +23,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.56 2007/02/01 19:10:29 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.57 2007/02/10 14:58:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -498,14 +498,14 @@ GuessControlValues(void) fprintf(stderr, _("%s: invalid LC_COLLATE setting\n"), progname); exit(1); } - StrNCpy(ControlFile.lc_collate, localeptr, LOCALE_NAME_BUFLEN); + strlcpy(ControlFile.lc_collate, localeptr, sizeof(ControlFile.lc_collate)); localeptr = setlocale(LC_CTYPE, ""); if (!localeptr) { fprintf(stderr, _("%s: invalid LC_CTYPE setting\n"), progname); exit(1); } - StrNCpy(ControlFile.lc_ctype, localeptr, LOCALE_NAME_BUFLEN); + strlcpy(ControlFile.lc_ctype, localeptr, sizeof(ControlFile.lc_ctype)); /* * XXX eventually, should try to grovel through old XLOG to develop more |