diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-28 13:31:20 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-11-28 13:31:20 +0000 |
commit | 8d26a577937b949de6da7bdb193aa0cd522bad74 (patch) | |
tree | ca1aa0eb0266d2a6e315c7088504d3d791fdedcf /usr.bin/cvs/cvs.c | |
parent | fffc0161dcdf0bb2d4fc182ec87e78e88c9cea6d (diff) |
snprintf() -> cvs_path_cat()
Diffstat (limited to 'usr.bin/cvs/cvs.c')
-rw-r--r-- | usr.bin/cvs/cvs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index 647ec69d11f..733e5c4c181 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.109 2006/11/14 15:39:41 xsa Exp $ */ +/* $OpenBSD: cvs.c,v 1.110 2006/11/28 13:31:19 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -255,8 +255,10 @@ main(int argc, char **argv) return (0); } - i = snprintf(fpath, sizeof(fpath), "%s/%s", current_cvsroot->cr_dir, - CVS_PATH_ROOT); + if (cvs_path_cat(current_cvsroot->cr_dir, CVS_PATH_ROOT, + fpath, sizeof(fpath)) >= sizeof(fpath)) + fatal("main: truncation"); + if (stat(fpath, &st) == -1 && cvs_cmdop != CVS_OP_INIT) { if (errno == ENOENT) fatal("repository '%s' does not exist", |