Re: getenv, putenv
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 18:19:35 +0100
floyd@xxxxxxxxxx (Floyd L. Davidson) writes:
Bhawna <bvnbhati@xxxxxxxxx> wrote:
Hi,
I am running a multithreaded application in which I am trying to set
an environment variable using putenv. The string I am using as
argument to putenv was created as
char *str=strdup(<local var>);
1) Don't use an auto variable.
This doesn't matter. The string needs to be alive for as it is still
part of the environment, not some random pointer to it.
2) The symbol "str" violates the implemenation's
name space if you have also included <strings.h>.
I don't think so. SUS only reserves any identifier beginning with str,
followed by a lower case letter.
.
- Follow-Ups:
- Re: getenv, putenv
- From: Floyd L. Davidson
- Re: getenv, putenv
- From: Måns Rullgård
- Re: getenv, putenv
- References:
- getenv, putenv
- From: Bhawna
- Re: getenv, putenv
- From: Floyd L. Davidson
- getenv, putenv
- Prev by Date: Re: getenv, putenv
- Next by Date: Re: getenv, putenv
- Previous by thread: Re: getenv, putenv
- Next by thread: Re: getenv, putenv
- Index(es):
Relevant Pages
|