summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/remove.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-01-10 10:08:23 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-01-10 10:08:23 +0000
commit0f5cebe91fb780a119496047300ea893bae226c3 (patch)
treed411a6955ad123193ade15923e0ff9bd79a352a0 /usr.bin/cvs/remove.c
parent1791d0588fc7a52ac71ad3cdd7bb28ddb8e53bdb (diff)
another strcspn() round
Diffstat (limited to 'usr.bin/cvs/remove.c')
-rw-r--r--usr.bin/cvs/remove.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c
index ac8c773955c..6a0f5625bb3 100644
--- a/usr.bin/cvs/remove.c
+++ b/usr.bin/cvs/remove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: remove.c,v 1.66 2007/09/22 16:01:22 joris Exp $ */
+/* $OpenBSD: remove.c,v 1.67 2008/01/10 10:08:22 tobias Exp $ */
/*
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
*
@@ -189,8 +189,7 @@ cvs_remove_local(struct cvs_file *cf)
sizeof(rbuf));
ctime_r(&cf->file_ent->ce_mtime, tbuf);
- if (tbuf[strlen(tbuf) - 1] == '\n')
- tbuf[strlen(tbuf) - 1] = '\0';
+ tbuf[strcspn(tbuf, "\n")] = '\0';
entry = xmalloc(CVS_ENT_MAXLINELEN);
(void)xsnprintf(entry, CVS_ENT_MAXLINELEN,