From owner-svn-src-all@FreeBSD.ORG Thu May 28 10:24:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80E7106566C; Thu, 28 May 2009 10:24:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D679C8FC17; Thu, 28 May 2009 10:24:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4SAOQuB032487; Thu, 28 May 2009 10:24:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4SAOQOt032486; Thu, 28 May 2009 10:24:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200905281024.n4SAOQOt032486@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 28 May 2009 10:24:26 +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: r192973 - head/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 10:24:28 -0000 Author: des Date: Thu May 28 10:24:26 2009 New Revision: 192973 URL: http://svn.freebsd.org/changeset/base/192973 Log: Use a temporary variable to avoid a duplicate strlen(). Submitted by: kib MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Thu May 28 08:22:36 2009 (r192972) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Thu May 28 10:24:26 2009 (r192973) @@ -364,12 +364,13 @@ pfs_vptocnp(struct vop_vptocnp_args *ap) } bcopy(pidbuf, buf + i, len); } else { - i -= strlen(pd->pn_name); + len = strlen(pd->pn_name); + i -= len; if (i < 0) { error = ENOMEM; goto failed; } - bcopy(pd->pn_name, buf + i, strlen(pd->pn_name)); + bcopy(pd->pn_name, buf + i, len); } pn = pd->pn_parent;