From bed557a12418588fcae36913ce647b302f92c57c Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Wed, 7 Feb 2007 17:54:43 +0000 Subject: strl* overload; use xsnprintf(); OK ray@. --- usr.bin/cvs/root.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'usr.bin/cvs/root.c') 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 * 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) { -- cgit v1.2.3