diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-01-25 11:13:19 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-01-25 11:13:19 +0000 |
commit | 6a0956f24233bd7d11438142efe5f89baf51cba6 (patch) | |
tree | 9829b982372c30dea3c543f74f4107eb46119602 /usr.bin/cvs | |
parent | 0e30b534b58a2a1036179cf82c18f411934d36d2 (diff) |
use cvs_rcs_getpath() instead of duplicating code.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/diff.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index c0bc3d323ad..1f26faffd80 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.76 2006/01/02 17:06:10 xsa Exp $ */ +/* $OpenBSD: diff.c,v 1.77 2006/01/25 11:13:18 xsa Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -535,7 +535,6 @@ cvs_diff_remote(struct cvs_file *cfp, void *arg) static int cvs_diff_local(CVSFILE *cf, void *arg) { - int len; char *repo, buf[64]; char fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; char path_tmp1[MAXPATHLEN], path_tmp2[MAXPATHLEN]; @@ -571,13 +570,7 @@ cvs_diff_local(CVSFILE *cf, void *arg) return (0); /* at this point, the file is modified */ - len = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s", - root->cr_dir, repo, diff_file, RCS_FILE_EXT); - if (len == -1 || len >= (int)sizeof(rcspath)) { - errno = ENAMETOOLONG; - cvs_log(LP_ERRNO, "%s", rcspath); - return (CVS_EX_DATA); - } + cvs_rcs_getpath(cf, rcspath, sizeof(rcspath)); rf = rcs_open(rcspath, RCS_READ); if (rf == NULL) { |