[Midnightbsd-cvs] src [10308] sync with freebsd 10 stable.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jun 3 14:56:21 EDT 2018


Revision: 10308
          http://svnweb.midnightbsd.org/src/?rev=10308
Author:   laffer1
Date:     2018-06-03 14:56:20 -0400 (Sun, 03 Jun 2018)
Log Message:
-----------
sync with freebsd 10 stable.

Modified Paths:
--------------
    trunk/usr.sbin/watch/watch.c

Property Changed:
----------------
    trunk/usr.sbin/watch/watch.8

Index: trunk/usr.sbin/watch/watch.8
===================================================================
--- trunk/usr.sbin/watch/watch.8	2018-06-03 18:55:19 UTC (rev 10307)
+++ trunk/usr.sbin/watch/watch.8	2018-06-03 18:56:20 UTC (rev 10308)

Property changes on: trunk/usr.sbin/watch/watch.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/watch/watch.c
===================================================================
--- trunk/usr.sbin/watch/watch.c	2018-06-03 18:55:19 UTC (rev 10307)
+++ trunk/usr.sbin/watch/watch.c	2018-06-03 18:56:20 UTC (rev 10308)
@@ -110,7 +110,6 @@
 {
 	struct termios	ntty;
 
-	tcgetattr(std_in, &otty);
 	ntty = otty;
 	ntty.c_lflag &= ~ICANON;	/* disable canonical operation */
 	ntty.c_lflag &= ~ECHO;
@@ -248,7 +247,7 @@
 	if ((sb.st_mode & S_IFMT) != S_IFCHR)
 		fatal(EX_DATAERR, "must be a character device");
 
-	strncpy(dev_name, buf, DEV_NAME_LEN);
+	strlcpy(dev_name, buf, sizeof(dev_name));
 
 	attach_snp();
 }
@@ -324,6 +323,8 @@
 			usage();
 		}
 
+	tcgetattr(std_in, &otty);
+
 	if (modfind("snp") == -1)
 		if (kldload("snp") == -1 || modfind("snp") == -1)
 			warn("snp module not available");
@@ -339,7 +340,7 @@
 		else
 			fatal(EX_DATAERR, "no device name given");
 	} else
-		strncpy(dev_name, *av, DEV_NAME_LEN);
+		strlcpy(dev_name, *av, sizeof(dev_name));
 
 	set_dev(dev_name);
 



More information about the Midnightbsd-cvs mailing list