Subject: Re: A little program I wrote that core dumps. Should it?
To: RiscBSD Mailing List <port-arm32@NetBSD.ORG>
From: Peter Naulls <pnaulls@wave.co.nz>
List: port-arm32
Date: 06/17/1997 00:11:24
> > void main(void) {
> > FILE *f;
> > f = fopen("/dev/lpt0");
> > while (!feof(f)) putchar(fgetc(f));
> > }
>
> A quick look in the (HPUX) manpage shows the following:
>
> FILE *fopen(const char *pathname, const char *type);
>
> so use `fopen("/dev/lpt0", "r")' !
Yeah, you're right of course - had slipped my mind. This could
just as easily cause a crash. I suggest people use -Wall on gcc :)
--
+-----------------------------------------+-----------------------------------+
| Peter Naulls | Acorn Risc PC 700 *ARM Powered* |
| pnaulls@wave.co.nz | Porting Java & Sather for Risc OS |
| http://lucy.cs.waikato.ac.nz/~pnaulls/ | Co-editor of Acorn archive list |
| Phone 64-7-856-4562 | Computer consultancy |
| The meaning of life: 3.5 | Web page design |
+-----------------------------------------+-----------------------------------+
Senders of unsolicited email agree to send me NZ$100 for wasting my time