Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 May 2009 10:24:26 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192973 - head/sys/fs/pseudofs
Message-ID:  <200905281024.n4SAOQOt032486@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905281024.n4SAOQOt032486>