-----BEGIN PGP SIGNED MESSAGE-----
On Friday 28 November 2003 10:42, David Woodhouse wrote:
> On Thu, 2003-11-27 at 23:09 +0100, Felipe Alfaro Solana wrote:
> > On Thu, 2003-11-27 at 21:48, Timo Kamph wrote:
> > > > + strlcpy(label->label, name, sizeof(label->name));
> > >
> > >
> > > ^^^^^^ I guess this shoud be label->label, or am I wrong?
> > Oh my god! Two consecutive mistakes with the same patch! I should have
> > some sleep... Here's the one with the typo corrected.
> Perhaps we should consider
> #define strsizecpy(x, y) strlcpy((x), (y), sizeof(x))
Then we should do:
#define strsizecpy(x, y) strlcpy(x, y, sizeof(x)/sizeof(x))
to rule out passing the wrong variables or dereferencing to much.
Unfortunatly there is no simple way in C to differentiate between array and
There is a way with typeof, but that is hackish.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
-----END PGP SIGNATURE-----