2003-07-01 10:19:02

by Andries E. Brouwer

[permalink] [raw]
Subject: blind conversion strncpy -> strlcpy is harmful

I notice that people have been replacing strncpy by strlcpy,
introducing bugs in the process.

It is not true that strlcpy is guaranteed to be better than
strncpy. Indeed, strlcpy cannot handle character arrays that
are not necessarily 0-terminated.