getenv question

Luke Davis ldavis at shellworld.net
Wed Jun 16 23:24:30 EDT 2004


Why the \0?  I don't recall that being necessary, when I used to do this.

What happens when you try a setenv or putenv first, and then try to 
recover it with getenv?


On Wed, 16 Jun 2004, Gregory Nowak wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all.
>
> I'm trying to use getenv in a c program, but it doesn't seem to work.
>
> - From within gdb, at the gdb prompt, I'm doing:
>
> export TEST=data
>
> However, in my program doing
>
> getenv("TEST\0");
>
> is returning a NULL pointer.
>
> Can someone please tell me what I'm missing? Thanks.
>
> Greg
>
>
> - --
> Free domains: http://www.eu.org/ or mail dns-manager at EU.org
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
>
> iD8DBQFA0Oxp7s9z/XlyUyARAtMQAKCjyFCVXmogJZQsORgbzUfFeg7FcQCdF7W0
> 1dZAFH/dFTzMFrOOMKThrv0=
> =Hvw6
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>




More information about the Speakup mailing list