Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Use strncpy here because we need to be portable...



details:   https://anonhg.NetBSD.org/src/rev/6d0c620e37a8
branches:  trunk
changeset: 821517:6d0c620e37a8
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 08 17:47:36 2017 +0000

description:
Use strncpy here because we need to be portable, and we have the +1 byte
to save us :-)

diffstat:

 usr.bin/make/main.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r cda83ae044a5 -r 6d0c620e37a8 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Wed Feb 08 17:30:27 2017 +0000
+++ b/usr.bin/make/main.c       Wed Feb 08 17:47:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $      */
+/*     $NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.256 2017/02/07 21:16:31 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.257 2017/02/08 17:47:36 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -449,7 +449,7 @@
                            stat(curdir, &sb) != -1 &&
                            sa.st_ino == sb.st_ino &&
                            sa.st_dev == sb.st_dev)
-                               strlcpy(curdir, argvalue, MAXPATHLEN);
+                               strncpy(curdir, argvalue, MAXPATHLEN);
                        ignorePWD = TRUE;
                        break;
                case 'D':



Home | Main Index | Thread Index | Old Index