Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2001 03:23:49 -0400 (EDT)
From:      "Andrew R. Reiter" <arr@watson.org>
To:        freebsd-audit@freebsd.org
Subject:   audit work:  leave.c usage() fix (more obsd sync)
Message-ID:  <Pine.NEB.3.96L.1010417032024.79724A-200000@fledge.watson.org>

index | next in thread | raw e-mail

[-- Attachment #1 --]
hi,

attached is a patch again for -current for leave.c.  the sync up with obsd
was the call usage() if the number of arguments is greater than two.  with
-Wall compile, it was also, of course, complaining about the register char
*cp not being initialized, so I just modified it to be set to NULL.

can also be found at http://www.watson.org/~arr/fbsd-audit/usr.bin/leave/

andrew

*-------------.................................................
| Andrew R. Reiter 
| arr@fledge.watson.org
| "It requires a very unusual mind
|   to undertake the analysis of the obvious" -- A.N. Whitehead

[-- Attachment #2 --]
--- leave.c.orig	Tue Apr 17 00:11:35 2001
+++ leave.c	Tue Apr 17 00:16:18 2001
@@ -69,7 +69,7 @@
 {
 	register u_int secs;
 	register int hours, minutes;
-	register char c, *cp;
+	register char c, *cp = NULL;
 	struct tm *t, *localtime();
 	time_t now, time();
 	int plusnow, t_12_hour;
@@ -84,7 +84,9 @@
 		cp = fgets(buf, sizeof(buf), stdin);
 		if (cp == NULL || *cp == '\n')
 			exit(0);
-	} else
+	} else if (argc > 2)
+		usage();
+	else
 		cp = argv[1];
 
 	if (*cp == '+') {
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010417032024.79724A-200000>