s[ln]printf ?

Gerald (Jerry) Carter jerry at samba.org
Fri Nov 12 21:49:57 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Why when I grep the current 3.0 code do I find lots of

	slprintf(rhostsfile, sizeof(rhostsfile)-1,
		"%s/.rhosts", home);

$ grep s[ln]printf */*.c | grep ')-1' | wc -l
255

include/includes.h:#define slprintf snprintf
include/includes.h:#define vslprintf vsnprintf

Everything I can find and the couple of other people
I've talked to agree that the buffer size snprintf()
includes the terminating NULL.

so why are we saving one byte extra in about 75% of
the calls?  Anyone want to enloighten me?  Maybe some
histiry I'm missing here.




cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBlTAFIR7qMdg1EfYRAlFBAJwMKhUXABKgu3Tjl/M8MTgJHeJJDQCfbCfD
L/PKjjQt3fDq2xyaees8qSI=
=+qA1
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list