summaryrefslogtreecommitdiff
path: root/src/bin/psql/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r--src/bin/psql/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index a503568361..4a49efeda7 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1497,7 +1497,7 @@ expand_tilde(char **filename)
if (*(fn + 1) == '\0')
get_home_path(home); /* ~ or ~/ only */
else if ((pw = getpwnam(fn + 1)) != NULL)
- StrNCpy(home, pw->pw_dir, MAXPGPATH); /* ~user */
+ strlcpy(home, pw->pw_dir, sizeof(home)); /* ~user */
*p = oldp;
if (strlen(home) != 0)