On 7/20/06, Peter Eriksen <s022018@student.dtu.dk> wrote: > The patch really should not change any semantics at all, since > it converts instances of > > memcpy(to, from, len); > to[len] = 0; > > into > > strlcpy(to, from, len); > > I need a bit of help troubleshooting this one. I have tried > running t0000-basic.sh using "bash -x", but that did not help > me this time. > Well, there are differences. Correct translation from memcpy to strlcpy (aside the fact with \0 inside the string) would be something like: strlcpy(to, from, len + 1); assuming your example with memcpy. strlcpy expects size of storage, and will never write more bytes that it was allowed to. That'll cut off last character of the source string, unless it is \0-terminated before the size of storage. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Fri Jul 21 17:23:24 2006
This archive was generated by hypermail 2.1.8 : 2006-07-21 17:23:52 EST