a new slprintf() function. This one is totally portable but a bit of a
authorAndrew Tridgell <tridge@samba.org>
Tue, 12 May 1998 12:48:54 +0000 (12:48 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 12 May 1998 12:48:54 +0000 (12:48 +0000)
commit1dadc7af9534977c8c384fd3e54e506710fb3659
treedcb17d07171b884cb259475b5504c63e6fad1c15
parentf888868f46a5418bac9ab528497136c152895305
a new slprintf() function. This one is totally portable but a bit of a
kludge. It is a safe kludge with our current code but I would like to
revisit it at some point in the future.

The problem with the one I committed yesterday is it used non-portable
functions. (it also had a bug in it, but that's another matter)

This one works by just using vsprintf() into a 8k buffer and a memcpy
from there. No memory protection tricks or other non-portable
stuff. This is safe because all calls to slprintf() in samba use
strings which have been through a pstrcpy and thus are less than 1024
bytes. No call uses more than 2 of these strings. See what I mean by
kludge? Note that the 8k is way overkill but I like overkill :)

Someday (after autoconf) we will replace this with something better,
but meanwhile this is simple, secure and portable.
(This used to be commit 4cfcc398c35c6726f14f485ae8e9ebcef180392f)
source3/lib/slprintf.c