Re: better snprintf replacement, anyone?
Alan Cox (alan@LXORGUK.UKUU.ORG.UK)
Tue, 22 Jul 1997 09:36:35 +0100
> you have a large enough buffer, you eliminate the buffer overflow problem,
> and you don't truncate the string. Is malloc()-ing the memory *that*
> inefficient? Less efficient than the scanning and parsing snprintf()
> must do to the format string?
In the case of a dynamic loader you don't have a libc backing you, thats
why someone took the (very wrong) shortcut they did originally when doing
ld.so
You are right about malloc for many cases, but its also true that you
normally know the length of a buffer anyway