Date: Mon, 9 Aug 1999 11:17:18 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Mark E." cc: djgpp-workers AT delorie DOT com Subject: Re: suggestion for getenv.c In-Reply-To: <199908082020.UAA80886@out1.ibm.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 8 Aug 1999, Mark E. wrote: > *************** getenv(const char *name) > *** 9,15 **** > { > int i; > > ! if (environ == 0) > return 0; > > for (i=0; environ[i]; i++) > --- 10,16 ---- > { > int i; > > ! if (environ == 0 || name == 0) > return 0; Why should we silently ignore a NULL pointer? If anything, we should set errno to EFAULT. `environ' being NULL is a valid situation, but passing a NULL `name' is not.