[Midnightbsd-cvs] src [10787] trunk/usr.bin/wall: use strlcat
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jun 9 22:51:37 EDT 2018
Revision: 10787
http://svnweb.midnightbsd.org/src/?rev=10787
Author: laffer1
Date: 2018-06-09 22:51:36 -0400 (Sat, 09 Jun 2018)
Log Message:
-----------
use strlcat
Modified Paths:
--------------
trunk/usr.bin/wall/Makefile
trunk/usr.bin/wall/ttymsg.c
trunk/usr.bin/wall/wall.c
Modified: trunk/usr.bin/wall/Makefile
===================================================================
--- trunk/usr.bin/wall/Makefile 2018-06-10 02:49:57 UTC (rev 10786)
+++ trunk/usr.bin/wall/Makefile 2018-06-10 02:51:36 UTC (rev 10787)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/wall/Makefile 202200 2010-01-13 18:09:54Z ed $
PROG= wall
SRCS= ttymsg.c wall.c
Modified: trunk/usr.bin/wall/ttymsg.c
===================================================================
--- trunk/usr.bin/wall/ttymsg.c 2018-06-10 02:49:57 UTC (rev 10786)
+++ trunk/usr.bin/wall/ttymsg.c 2018-06-10 02:51:36 UTC (rev 10787)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -29,7 +30,7 @@
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/wall/ttymsg.c 286269 2015-08-04 03:06:23Z pfg $");
#ifndef lint
static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93";
@@ -62,7 +63,7 @@
struct iovec localiov[7];
ssize_t left, wret;
int cnt, fd;
- static char device[MAXNAMLEN] = _PATH_DEV;
+ char device[MAXNAMLEN] = _PATH_DEV;
static char errbuf[1024];
char *p;
int forked;
@@ -71,8 +72,8 @@
if (iovcnt > (int)(sizeof(localiov) / sizeof(localiov[0])))
return ("too many iov's (change code in wall/ttymsg.c)");
+ strlcat(device, line, sizeof(device));
p = device + sizeof(_PATH_DEV) - 1;
- strlcpy(p, line, sizeof(device));
if (strncmp(p, "pts/", 4) == 0)
p += 4;
if (strchr(p, '/') != NULL) {
Modified: trunk/usr.bin/wall/wall.c
===================================================================
--- trunk/usr.bin/wall/wall.c 2018-06-10 02:49:57 UTC (rev 10786)
+++ trunk/usr.bin/wall/wall.c 2018-06-10 02:51:36 UTC (rev 10787)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -29,7 +30,7 @@
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/wall/wall.c 241848 2012-10-22 03:07:05Z eadler $");
#ifndef lint
static const char copyright[] =
@@ -70,14 +71,14 @@
static void makemsg(char *);
static void usage(void);
-struct wallgroup {
+static struct wallgroup {
struct wallgroup *next;
char *name;
gid_t gid;
} *grouplist;
-int nobanner;
-int mbufsize;
-char *mbuf;
+static int nobanner;
+static int mbufsize;
+static char *mbuf;
static int
ttystat(char *line)
More information about the Midnightbsd-cvs
mailing list