[Midnightbsd-cvs] src [11471] trunk/usr.bin/msgs/msgs.c: make some things static

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 12:56:46 EDT 2018


Revision: 11471
          http://svnweb.midnightbsd.org/src/?rev=11471
Author:   laffer1
Date:     2018-07-07 12:56:45 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
make some things static

Modified Paths:
--------------
    trunk/usr.bin/msgs/Makefile
    trunk/usr.bin/msgs/msgs.1
    trunk/usr.bin/msgs/msgs.c

Property Changed:
----------------
    trunk/usr.bin/msgs/msgs.1

Modified: trunk/usr.bin/msgs/Makefile
===================================================================
--- trunk/usr.bin/msgs/Makefile	2018-07-07 16:56:25 UTC (rev 11470)
+++ trunk/usr.bin/msgs/Makefile	2018-07-07 16:56:45 UTC (rev 11471)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	From: @(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/msgs/Makefile 201386 2010-01-02 10:27:05Z ed $
 
 PROG=	msgs
 DPADD=	${LIBTERMCAP}

Modified: trunk/usr.bin/msgs/msgs.1
===================================================================
--- trunk/usr.bin/msgs/msgs.1	2018-07-07 16:56:25 UTC (rev 11470)
+++ trunk/usr.bin/msgs/msgs.1	2018-07-07 16:56:45 UTC (rev 11471)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -26,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)msgs.1	8.2 (Berkeley) 4/28/95
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/msgs/msgs.1 216370 2010-12-11 08:32:16Z joel $
 .\"
 .Dd April 28, 1995
 .Dt MSGS 1


Property changes on: trunk/usr.bin/msgs/msgs.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/msgs/msgs.c
===================================================================
--- trunk/usr.bin/msgs/msgs.c	2018-07-07 16:56:25 UTC (rev 11470)
+++ trunk/usr.bin/msgs/msgs.c	2018-07-07 16:56:45 UTC (rev 11471)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1980, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -40,7 +41,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/msgs/msgs.c 300266 2016-05-20 06:05:20Z truckman $");
 
 /*
  * msgs - a user bulletin board program
@@ -105,47 +106,47 @@
 
 typedef	char	bool;
 
-FILE	*msgsrc;
-FILE	*newmsg;
-const char *sep = "-";
-char	inbuf[BUFSIZ];
-char	fname[MAXPATHLEN];
-char	cmdbuf[MAXPATHLEN + MAXPATHLEN];
-char	subj[128];
-char	from[128];
-char	date[128];
-char	*ptr;
-char	*in;
-bool	local;
-bool	ruptible;
-bool	totty;
-bool	seenfrom;
-bool	seensubj;
-bool	blankline;
-bool	printing = NO;
-bool	mailing = NO;
-bool	quitit = NO;
-bool	sending = NO;
-bool	intrpflg = NO;
-uid_t	uid;
-int	msg;
-int	prevmsg;
-int	lct;
-int	nlines;
-int	Lpp = 0;
-time_t	t;
-time_t	keep;
+static FILE	*msgsrc;
+static FILE	*newmsg;
+static const char *sep = "-";
+static char	inbuf[BUFSIZ];
+static char	fname[MAXPATHLEN];
+static char	cmdbuf[MAXPATHLEN + MAXPATHLEN];
+static char	subj[128];
+static char	from[128];
+static char	date[128];
+static char	*ptr;
+static char	*in;
+static bool	local;
+static bool	ruptible;
+static bool	totty;
+static bool	seenfrom;
+static bool	seensubj;
+static bool	blankline;
+static bool	printing = NO;
+static bool	mailing = NO;
+static bool	quitit = NO;
+static bool	sending = NO;
+static bool	intrpflg = NO;
+static uid_t	uid;
+static int	msg;
+static int	prevmsg;
+static int	lct;
+static int	nlines;
+static int	Lpp = 0;
+static time_t	t;
+static time_t	keep;
 
 /* option initialization */
-bool	hdrs = NO;
-bool	qopt = NO;
-bool	hush = NO;
-bool	send_msg = NO;
-bool	locomode = NO;
-bool	use_pager = NO;
-bool	clean = NO;
-bool	lastcmd = NO;
-jmp_buf	tstpbuf;
+static bool	hdrs = NO;
+static bool	qopt = NO;
+static bool	hush = NO;
+static bool	send_msg = NO;
+static bool	locomode = NO;
+static bool	use_pager = NO;
+static bool	clean = NO;
+static bool	lastcmd = NO;
+static jmp_buf	tstpbuf;
 
 static void	ask(const char *);
 static void	gfrsub(FILE *);
@@ -155,7 +156,7 @@
 static void	onsusp(int);
 static void	onintr(int);
 static void	prmesg(int);
-static void usage(void);
+static void	usage(void);
 
 int
 main(int argc, char *argv[])
@@ -855,7 +856,7 @@
 			}
 			*ptr = '\0';
 			if (*(in = nxtfld(in)))
-				strncpy(date, in, sizeof date);
+				strlcpy(date, in, sizeof date);
 			else {
 				date[0] = '\n';
 				date[1] = '\0';
@@ -886,7 +887,7 @@
 		if (!seensubj && strncmp(inbuf, "Subj", 4)==0) {
 			seensubj = YES;
 			frompos = ftello(infile);
-			strncpy(subj, nxtfld(inbuf), sizeof subj);
+			strlcpy(subj, nxtfld(inbuf), sizeof subj);
 		}
 	}
 	if (!blankline)
@@ -899,7 +900,7 @@
 		/*
 		 * for possible use with Mail
 		 */
-		strncpy(subj, "(No Subject)\n", sizeof subj);
+		strlcpy(subj, "(No Subject)\n", sizeof subj);
 }
 
 static char *



More information about the Midnightbsd-cvs mailing list