summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-03-10 05:57:40 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-03-10 05:57:40 +0000
commitb651e4381337718aa610e2d6ee76d3b65f2beeb8 (patch)
tree9ed34538fe13fba9c9a44f75f4fba6fdfefc92ae
parent65045b20124b1e8abfcefa270bf282da2b7d61b1 (diff)
Only write a log message if the log message is not empty.
Also prevents rfp->rf_desc[-1] from happening. ok joris, niallo, otto, and xsa
-rw-r--r--usr.bin/cvs/rcs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index b35fcf6b683..bc5ed2d911a 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.140 2006/03/09 10:56:33 xsa Exp $ */
+/* $OpenBSD: rcs.c,v 1.141 2006/03/10 05:57:39 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -512,8 +512,7 @@ rcs_write(RCSFILE *rfp)
}
fputs("\ndesc\n@", fp);
- if (rfp->rf_desc != NULL) {
- len = strlen(rfp->rf_desc);
+ if (rfp->rf_desc != NULL && (len = strlen(rfp->rf_desc)) > 0) {
rcs_strprint((const u_char *)rfp->rf_desc, len, fp);
if (rfp->rf_desc[len-1] != '\n')
fputc('\n', fp);