summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-07-18 06:58:49 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-07-18 06:58:49 +0000
commit81bd93144291aa98cea262e6eaf25cbf0e47ea37 (patch)
tree96d93ed8006ca8b109252d296c60a1656d212606
parentb4d6d93faf460ea05b87fc0f74122785636e23d8 (diff)
use cvs_path_cat() where appropriate; ok joris@.
-rw-r--r--usr.bin/cvs/proto.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c
index 47374773f5e..4dd13c41b0d 100644
--- a/usr.bin/cvs/proto.c
+++ b/usr.bin/cvs/proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.c,v 1.59 2005/07/09 16:27:34 niallo Exp $ */
+/* $OpenBSD: proto.c,v 1.60 2005/07/18 06:58:48 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -973,7 +973,7 @@ cvs_recvraw(struct cvsroot *root, void *dst, size_t len)
int
cvs_senddir(struct cvsroot *root, CVSFILE *dir)
{
- int l;
+ size_t len;
char lbuf[MAXPATHLEN], rbuf[MAXPATHLEN];
if (dir->cf_type != DT_DIR)
@@ -986,13 +986,10 @@ cvs_senddir(struct cvsroot *root, CVSFILE *dir)
if (dir->cf_repo == NULL)
strlcpy(rbuf, root->cr_dir, sizeof(rbuf));
else {
- l = snprintf(rbuf, sizeof(rbuf), "%s/%s", root->cr_dir,
- dir->cf_repo);
- if (l == -1 || l >= (int)sizeof(rbuf)) {
- errno = ENAMETOOLONG;
- cvs_log(LP_ERRNO, "%s", rbuf);
+ len = cvs_path_cat(root->cr_dir, dir->cf_repo, rbuf,
+ sizeof(rbuf));
+ if (len >= sizeof(rbuf))
return (-1);
- }
}