From: noer AT cygnus DOT com (Geoffrey Noer) Subject: Re: Strange things... 18 Mar 1998 05:11:19 -0800 Message-ID: <199803162334.PAA26599.cygnus.gnu-win32@skaro.cygnus.com> References: <3 DOT 0 DOT 32 DOT 19980314103340 DOT 007b5380 AT wilmington DOT net> Content-Type: text To: Keetnet AT wilmington DOT net (Keet / Foxbird) Cc: gnu-win32 AT cygnus DOT com Keet / Foxbird wrote: > > Well, in response to my previous message, and with no help from very very > few, I debuged my program the old fashioned way. Putting 'fprintf(stderr, > "Line 1")' every so often in the code so I could see where the problem > arose and I found the culprit. The program reads a value from the > environment and then copies it into a string. 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? Running man setenv on a Solaris box: [...] > RETURN VALUES > If successful, getenv() returns a pointer to the value in > the current environment; otherwise, it returns a null > pointer. [...] Cygwin32 getenv does this so it looks right to me. -- Geoffrey Noer noer AT cygnus DOT com - 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".