[Midnightbsd-cvs] src [11544] trunk/usr.bin/finger: fix a few things

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 16:40:15 EDT 2018


Revision: 11544
          http://svnweb.midnightbsd.org/src/?rev=11544
Author:   laffer1
Date:     2018-07-07 16:40:15 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
fix a few things

Modified Paths:
--------------
    trunk/usr.bin/finger/Makefile
    trunk/usr.bin/finger/finger.c
    trunk/usr.bin/finger/lprint.c

Modified: trunk/usr.bin/finger/Makefile
===================================================================
--- trunk/usr.bin/finger/Makefile	2018-07-07 20:39:22 UTC (rev 11543)
+++ trunk/usr.bin/finger/Makefile	2018-07-07 20:40:15 UTC (rev 11544)
@@ -1,10 +1,9 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/finger/Makefile 226358 2011-10-14 07:24:23Z ed $
 
 PROG=	finger
 SRCS=	finger.c lprint.c net.c sprint.c util.c
 MAN=	finger.1 finger.conf.5
 
-WARNS?=	2
-
 .include <bsd.prog.mk>

Modified: trunk/usr.bin/finger/finger.c
===================================================================
--- trunk/usr.bin/finger/finger.c	2018-07-07 20:39:22 UTC (rev 11543)
+++ trunk/usr.bin/finger/finger.c	2018-07-07 20:40:15 UTC (rev 11544)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -53,7 +54,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/finger/finger.c 241737 2012-10-19 14:49:42Z ed $");
 
 /*
  * Finger prints out information about users.  It is not portable since
@@ -87,7 +88,8 @@
 
 DB *db;
 time_t now;
-int entries, gflag, kflag, lflag, mflag, pplan, sflag, oflag;
+static int kflag, mflag, sflag;
+int entries, gflag, lflag, pplan, oflag;
 sa_family_t family = PF_UNSPEC;
 int d_first = -1;
 char tbuf[1024];
@@ -287,7 +289,7 @@
 
 	/* Pull out all network requests. */
 	for (ap = p = argv, np = nargv; *p; ++p)
-		if (index(*p, '@'))
+		if (strchr(*p, '@'))
 			*np++ = *p;
 		else
 			*ap++ = *p;
@@ -299,8 +301,8 @@
 		goto net;
 
 	/*
-	 * Mark any arguments beginning with '/' as invalid so that we 
-	 * don't accidently confuse them with expansions from finger.conf
+	 * Mark any arguments beginning with '/' as invalid so that we
+	 * don't accidentally confuse them with expansions from finger.conf
 	 */
 	for (p = argv, ip = used; *p; ++p, ++ip)
 	    if (**p == '/') {

Modified: trunk/usr.bin/finger/lprint.c
===================================================================
--- trunk/usr.bin/finger/lprint.c	2018-07-07 20:39:22 UTC (rev 11543)
+++ trunk/usr.bin/finger/lprint.c	2018-07-07 20:40:15 UTC (rev 11544)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -37,7 +38,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/finger/lprint.c 226358 2011-10-14 07:24:23Z ed $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -306,7 +307,7 @@
 		return(0);
 
 	/* If short enough, and no newlines, show it on a single line.*/
-	if (sb.st_size <= LINE_LEN - strlen(header) - 5) {
+	if (sb.st_size <= (off_t)(LINE_LEN - strlen(header) - 5)) {
 		nr = read(fd, tbuf, sizeof(tbuf));
 		if (nr <= 0) {
 			(void)close(fd);



More information about the Midnightbsd-cvs mailing list