From: Geoff Bull <geoff@research.canon.com.au>
Subject: Re: ada/c if - putenv?
Date: 2000/03/08
Date: 2000-03-08T00:38:11+00:00 [thread overview]
Message-ID: <38C5A116.4AC1132D@research.canon.com.au> (raw)
In-Reply-To: 38C58905.8E89F18E@acm.org
Jeff Carter wrote:
>
> Your program works fine as-is with GNAT 3.12p/Win98.
>
> I don't know how putenv is supposed to work, but that Free in your
> Putenv procedure looks suspicious ...
Yes that's it.
man putenv gives this information:
the string pointed to by string
becomes part of the environment, so altering the string will
change the environment.
...
A potential error is to call the function putenv() with a
pointer to an automatic variable as the argument and to then
exit the calling function while string is still part of the
environment.
And deallocating the string is equally a problem.
I've seen this answered here a few times over the years.
Cheers
Geoff
next prev parent reply other threads:[~2000-03-08 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-07 0:00 ada/c if - putenv? Al Johnston
2000-03-07 0:00 ` Jeff Carter
2000-03-08 0:00 ` Geoff Bull [this message]
2000-03-07 0:00 ` Al Johnston
2000-03-14 0:00 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox