From 0f5cebe91fb780a119496047300ea893bae226c3 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Thu, 10 Jan 2008 10:08:23 +0000 Subject: another strcspn() round --- usr.bin/cvs/remove.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/remove.c') 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 * @@ -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, -- cgit v1.2.3