Re: [PATCH] [TRIVIAL] kstrdup

Valdis.Kletnieks@vt.edu
Tue, 14 Jan 2003 00:15:31 -0500


--==_Exmh_-605521789P
Content-Type: text/plain; charset=us-ascii

On Mon, 13 Jan 2003 23:15:14 EST, Jeff Garzik said:
> But having said that -- see my mail to Rusty about storing the strlen()
> result and then calling memcpy(). It [purposefully] does not address
> the fact that the string may become stale data, because it's the job of
> a higher level to ensure that. But it does make explicit a compiler
> temporary, and allows us to use the presumeably-faster memcpy().

5 second's thought and another shot of Cherry Coke and it suddenly dawns
on me that memcpy() addresses my concerns as well as strncpy(), and as you
noted is presumably faster as well (since it doesn't have to keep looking for
a terminating null).

--==_Exmh_-605521789P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQE+I5zzcC3lWbTT17ARAmujAKC2PQAXQgUD7ktNCVjoHnew5vc7CQCgyEvI
4saGfUKV/exaJJ4J1nwguf8=
=JDsy
-----END PGP SIGNATURE-----

--==_Exmh_-605521789P--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/