diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-02-07 17:54:43 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-02-07 17:54:43 +0000 |
commit | bed557a12418588fcae36913ce647b302f92c57c (patch) | |
tree | 0c151b9c04414c8bcd3242ceecee1f452e05a1fd /usr.bin/cvs/root.c | |
parent | 21f57bcbf57691e121daafa905a0f81a62ca5d74 (diff) |
strl* overload; use xsnprintf(); OK ray@.
Diffstat (limited to 'usr.bin/cvs/root.c')
-rw-r--r-- | usr.bin/cvs/root.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c index 502f773031e..20b0f51f92f 100644 --- a/usr.bin/cvs/root.c +++ b/usr.bin/cvs/root.c @@ -1,4 +1,4 @@ -/* $OpenBSD: root.c,v 1.34 2007/01/18 22:52:23 niallo Exp $ */ +/* $OpenBSD: root.c,v 1.35 2007/02/07 17:54:42 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -229,13 +229,7 @@ cvsroot_get(const char *dir) if (cvs_rootstr != NULL) return cvsroot_parse(cvs_rootstr); - if (strlcpy(rootpath, dir, sizeof(rootpath)) >= sizeof(rootpath) || - strlcat(rootpath, "/", sizeof(rootpath)) >= sizeof(rootpath) || - strlcat(rootpath, CVS_PATH_ROOTSPEC, - sizeof(rootpath)) >= sizeof(rootpath)) { - errno = ENAMETOOLONG; - fatal("cvsroot_get: %s: %s", rootpath, strerror(errno)); - } + (void)xsnprintf(rootpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_ROOTSPEC); if ((fp = fopen(rootpath, "r")) == NULL) { if (errno == ENOENT) { |