Date: Wed, 5 Jan 2000 10:37:10 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Dlanor Blytkerchan cc: djgpp AT delorie DOT com Subject: Re: a bug? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 3 Jan 2000, Dlanor Blytkerchan wrote: > : #include > : > : int main(void) { > : int i; > : > : for (i = 0; i < TMP_MAX; i++) printf("%d: %p\n", tmpfile()); > : } // main() > displays (on my computer) 23 pointers and subsequently hangs. Thanks for the report and a clear test case. This is indeed a bug in `tmpfile': it doesn't take in consideration that file creation can fail when all the file handles available to DOS are exhausted. This bug will be corrected in the next DJGPP release. If you have an urgent need for a fixed version, I can send the corrected source. Btw, the exact number of files this program opens before it returns a NULL pointer is determined by your system configuration (the FILES= directive in CONFIG.SYS and some other factors). See section 9.6 of the DJGPP FAQ list for more about this.