delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/17/14:29:32

From: marcus AT bighorn DOT dr DOT lucent DOT com
Subject: Re: Strange things...
17 Mar 1998 14:29:32 -0800 :
Message-ID: <199803161514.IAA06079.cygnus.gnu-win32@chorus.dr.lucent.com>
To: gnu-win32 AT cygnus DOT com

> But I suspect that GETENV
>returns a null, and when it's passed to strncpy it decides to go belly up.
>I'm not sure if GETENV is supposed to return an empty string or a null? Any
>help on this one?

Sure, it's perfectly normal for getenv() to return NULL.  If the requested
variable does not exist in the environment, it will return NULL.  (If it
exists and is set to an empty string, then getenv() will return an empty
string.)

From the man page:

     RETURN VALUES
          If successful, getenv() returns a pointer to the value in
          the current environment; otherwise, it returns a null
          pointer.

marcus hall


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019