Messages in this thread | | | Subject | Re: [PATCH] [TRIVIAL] kstrdup | From | Valdis.Kletnieks@vt ... | Date | Tue, 14 Jan 2003 00:15:31 -0500 |
| |
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).
[unhandled content-type:application/pgp-signature] | |