diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2007-02-07 00:52:35 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2007-02-07 00:52:35 +0000 |
commit | 16059d39a04f5307e9b4dade10e70e5a4939a6db (patch) | |
tree | e9c9a3248870a743e30edbba47c0092ecf8b1832 /src/test/regress/pg_regress.c | |
parent | f11aa82d0378c48da9fc67e479699a1f8bb99483 (diff) |
Replace some strncpy() by strlcpy().
Diffstat (limited to 'src/test/regress/pg_regress.c')
-rw-r--r-- | src/test/regress/pg_regress.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b06dd1bf2ca..6aee04c63f1 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.28 2007/02/01 19:10:30 momjian Exp $ + * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.29 2007/02/07 00:52:35 petere Exp $ * *------------------------------------------------------------------------- */ @@ -349,8 +349,7 @@ replace_string(char *string, char *replace, char *replacement) { char *dup = strdup(string); - strncpy(string, dup, ptr - string); - string[ptr - string] = 0; + strlcpy(string, dup, ptr - string + 1); strcat(string, replacement); strcat(string, dup + (ptr - string) + strlen(replace)); free(dup); |