summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-10-16 00:25:15 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-10-16 00:25:15 +0000
commita2ac6e359b908e448b2ed553a2511df78f5ad286 (patch)
tree16fb596c629308aa60721932398538fe7f2ee003 /usr.bin/rcs/rcsprog.c
parentb8c52a6f8c08fafd174c3f0ed9497461eaaa49a6 (diff)
fix off-by-one in RCSINIT code, noticed by niallo@
for this my karma drops by 10 points;
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r--usr.bin/rcs/rcsprog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index c382feea62d..39c14379a90 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.29 2005/10/15 23:39:36 joris Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.30 2005/10/16 00:25:14 joris Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -217,8 +217,8 @@ main(int argc, char **argv)
cvs_log_init(LD_STD, 0);
cmd_argc = 0;
+ cmd_argv[cmd_argc++] = argv[0];
if ((rcsinit = getenv("RCSINIT")) != NULL) {
- cmd_argv[cmd_argc++] = argv[0];
ret = rcs_init(rcsinit, cmd_argv + 1,
RCS_CMD_MAXARG - 1);
if (ret < 0) {
@@ -337,6 +337,7 @@ rcs_main(int argc, char **argv)
argc -= rcs_optind;
argv += rcs_optind;
+
if (argc == 0) {
cvs_log(LP_ERR, "no input file");
(usage)();