Using environment variables without leaking memory?

Rich Felker dalias at aerifal.cx
Thu Oct 26 20:20:14 UTC 2006


On Thu, Oct 26, 2006 at 03:17:52PM -0400, Dave Dodge wrote:
> > If the standard just says you can modify the memory,
> 
> The API for putenv() guarantees that the string is placed into environ
> and modifying the string after the call shall modify the environment.

Oh, I missed this, so disregard the contradicting things I said in the
other email. putenv() is actually rather nice then..

BTW do you know if getenv() is required to return the actual strings
from the environment? (i.e. if getenv("HOME")-5 necessarily points to
the "H")

Rich




More information about the uClibc mailing list