fprintf() weirdness?

Chet Ramey chet at pirate.CWRU.EDU
Fri Dec 16 02:34:44 AEST 1988


In article <8457 at bloom-beacon.MIT.EDU> eichin at athena.mit.edu (Mark W. Eichin) writes:
=Strange problem: I have a mail-fetch program which uses authenticated
=POP to talk to a mail server and retrieve mail. It uses an SMTP-like
=protocol, ie. commands are text with \r\n at the end of each line.
=
=It runs perfectly on the VAX and IBM PC/RT under 4.3BSD. When I
=compile it under A/UX and run it, I get a core dump in the first
=
=	fprintf(f, "%s\r\n", buf);
=
=where f=fdopen(s, "r") earlier (and is not NULL...) The catch: If I
=change the fprintf to a
=
=	fputs(buf,f); fputs("\r\n",f);
=
=it works.

Well, you could try opening the file for writing (unless that was just a 
typo above), with an fdopen(s,"r+") or fdopen(s,"w").  I don't know why the
fputs is working now, though -- maybe it doesn't do the checking that 
fprintf does?

=				Mark Eichin
=			<eichin at athena.mit.edu>
=		SIPB Member & Project Athena ``Watchmaker'' 

Chet Ramey            			chet at cwjcc.CWRU.EDU
Network Management Group		chet at alpha.CES.CWRU.EDU
Andrew R. Jennings Computing Center	chet at pirate.CWRU.EDU
Case Western Reserve University



More information about the Comp.unix.aux mailing list