www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/18/22:16:21

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1634
Path: news-dnh.mv.net!mv!news.sprintlink.net!cs.utexas.edu!news.unt.edu!jove!iz03
From: iz03 AT jove DOT acs DOT unt DOT edu (Ertung Bora)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BUG IN V2??
Date: 18 Aug 95 16:46:52 GMT
Organization: University of North Texas
Lines: 41
Distribution: inet
References: <DDBHEv DOT HFu AT jade DOT mv DOT net> <410ib1$qtl AT mark DOT ucdavis DOT edu>
Nntp-Posting-Host: jove.acs.unt.edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

You look like pretty experienced programmer :). But As a matter of fact,
this is a test program to test the different behaviours of standart
C functions of different compilers.And I am pretty sure your comment
will work. Thanks for advice anyway, it could help the beginners.

Bora Ertung
UNT advanced computing lab. 

elric AT wheel DOT ucdavis DOT edu (Jeffrey Taylor) writes:

>Is there any requirement for argv[1] to be dereferencable if argc == 1?  
>If this were my program, I would guess I had gotten lucky on the OS and 
>check before I call fopen.

>Bora Ertung (bertung AT gab DOT unt DOT edu) wrote:
>: main(int argc,char **argv)
>: {
>:  FILE *yyin;
>:  yyin=fopen(argv[1],"r");
>:  if(!yyin)exit(0);
>: }

>: Lets assume that our program' name is test. When we
>: just enter 
>: c:\>test
>: Abort!

>: wowww..It is not suppose to be a bug at all. Because it works fine with
>: gcc for unix. But, 'fopen' may return 'null' if 'filename' is 'null'
>:  instead of saying 'Abort!' because of the 'null' filename.
>: And of course it is pretty logical to catch null pointer assingments.
>: But, It was working with official version of the djgpp.May be I am just 
>: dreaming.

>: Bora

>--
>============================================
>Without my guitar, I am a poet without arms.
>                        - Michael Bloomfield
>============================================

- Raw text -


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