From owner-svn-src-head@FreeBSD.ORG Sat Dec 17 01:29:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B2F106564A; Sat, 17 Dec 2011 01:29:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98DFB8FC08; Sat, 17 Dec 2011 01:29:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBH1TksQ036622; Sat, 17 Dec 2011 01:29:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBH1TkWj036618; Sat, 17 Dec 2011 01:29:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201112170129.pBH1TkWj036618@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Dec 2011 01:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228615 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2011 01:29:46 -0000 Author: dim Date: Sat Dec 17 01:29:46 2011 New Revision: 228615 URL: http://svn.freebsd.org/changeset/base/228615 Log: In sbin/dhclient, since we know the size of the source strings anyway, we might as well use memcpy; strlcpy is really unnecessary here. MFC after: 1 week Modified: head/sbin/dhclient/clparse.c head/sbin/dhclient/parse.c Modified: head/sbin/dhclient/clparse.c ============================================================================== --- head/sbin/dhclient/clparse.c Sat Dec 17 01:19:07 2011 (r228614) +++ head/sbin/dhclient/clparse.c Sat Dec 17 01:29:46 2011 (r228615) @@ -895,7 +895,7 @@ parse_string_list(FILE *cfile, struct st tmp = new_string_list(valsize); if (tmp == NULL) error("no memory for string list entry."); - strlcpy(tmp->string, val, valsize); + memcpy(tmp->string, val, valsize); tmp->next = NULL; /* Store this medium at the end of the media list. */ Modified: head/sbin/dhclient/parse.c ============================================================================== --- head/sbin/dhclient/parse.c Sat Dec 17 01:19:07 2011 (r228614) +++ head/sbin/dhclient/parse.c Sat Dec 17 01:29:46 2011 (r228615) @@ -129,7 +129,7 @@ parse_string(FILE *cfile) s = malloc(valsize); if (!s) error("no memory for string %s.", val); - strlcpy(s, val, valsize); + memcpy(s, val, valsize); if (!parse_semi(cfile)) return (NULL); @@ -295,7 +295,7 @@ parse_numeric_aggregate(FILE *cfile, uns t = malloc(valsize); if (!t) error("no temp space for number."); - strlcpy(t, val, valsize); + memcpy(t, val, valsize); c = cons(t, c); } } while (++count != *max);