summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/edit.c
diff options
context:
space:
mode:
authorxsa <xsa@openbsd.org>2007-02-17 18:23:43 +0000
committerxsa <xsa@openbsd.org>2007-02-17 18:23:43 +0000
commite40de241ebb0b43a01ed01750436af5b17e04284 (patch)
tree324e074cd5bdf17006245ae5163a2901344b75ad /usr.bin/cvs/edit.c
parentBring in the AMD errata checks from amd64. (diff)
downloadwireguard-openbsd-e40de241ebb0b43a01ed01750436af5b17e04284.tar.xz
wireguard-openbsd-e40de241ebb0b43a01ed01750436af5b17e04284.zip
cvs_path_cat() removal since we can now easily handle that
functionality w/ xsnprintf(); Initial diff started by thib@. OK thib@ joris@.
Diffstat (limited to 'usr.bin/cvs/edit.c')
-rw-r--r--usr.bin/cvs/edit.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c
index 7c8bf893b67..cd562833976 100644
--- a/usr.bin/cvs/edit.c
+++ b/usr.bin/cvs/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.32 2007/02/09 03:49:15 joris Exp $ */
+/* $OpenBSD: edit.c,v 1.33 2007/02/17 18:23:43 xsa Exp $ */
/*
* Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org>
*
@@ -298,9 +298,8 @@ cvs_edit_local(struct cvs_file *cf)
if (fchmod(cf->fd, 0644) == -1)
fatal("cvs_edit_local: fchmod %s", strerror(errno));
- if (cvs_path_cat(CVS_PATH_BASEDIR, cf->file_name, bfpath,
- MAXPATHLEN) >= MAXPATHLEN)
- fatal("cvs_edit_local: truncation");
+ (void)xsnprintf(bfpath, MAXPATHLEN, "%s/%s",
+ CVS_PATH_BASEDIR, cf->file_name);
if (mkdir(CVS_PATH_BASEDIR, 0755) == -1 && errno != EEXIST)
fatal("cvs_edit_local: `%s': %s", CVS_PATH_BASEDIR,
@@ -335,9 +334,8 @@ cvs_unedit_local(struct cvs_file *cf)
cvs_file_classify(cf, NULL);
- if (cvs_path_cat(CVS_PATH_BASEDIR, cf->file_name, bfpath,
- MAXPATHLEN) >= MAXPATHLEN)
- fatal("cvs_unedit_local: truncation");
+ (void)xsnprintf(bfpath, MAXPATHLEN, "%s/%s",
+ CVS_PATH_BASEDIR, cf->file_name);
if (stat(bfpath, &st) == -1)
return;