summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/util.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2007-10-05 19:28:24 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2007-10-05 19:28:24 +0000
commit91be8bab3c8cdead892a30c54b7f364fb936ae7c (patch)
tree2a6d009cb6176dd7fbe0e5d09e2047f70b0b9766 /usr.bin/cvs/util.c
parent16fbc333c2309760bf1d04d61e76b3e3d72cfba3 (diff)
strcspn() change
was okay'd by pyr@ and ok by millert@
Diffstat (limited to 'usr.bin/cvs/util.c')
-rw-r--r--usr.bin/cvs/util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index 316263e8957..b11452c8020 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.119 2007/09/22 16:01:22 joris Exp $ */
+/* $OpenBSD: util.c,v 1.120 2007/10/05 19:28:23 gilles Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
@@ -585,8 +585,7 @@ cvs_mkpath(const char *path, char *tag)
if ((fp = fopen(CVS_PATH_REPOSITORY, "r")) != NULL) {
if ((fgets(repo, sizeof(repo), fp)) == NULL)
fatal("cvs_mkpath: bad repository file");
- if ((len = strlen(repo)) && repo[len - 1] == '\n')
- repo[len - 1] = '\0';
+ repo[strcspn(repo, "\n")] = '\0';
(void)fclose(fp);
}
}