Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!pirate!chet From: chet@pirate.CWRU.EDU (Chet Ramey) Newsgroups: comp.unix.aux Subject: Re: fprintf() weirdness? Keywords: portability fprintf core Message-ID: <347@cwjcc.CWRU.Edu> Date: 15 Dec 88 16:34:44 GMT References: <8457@bloom-beacon.MIT.EDU> Sender: news@cwjcc.CWRU.Edu Reply-To: chet@cwjcc.CWRU.EDU (Chet Ramey) Organization: CWRU Andrew R. Jennings Computing Center Lines: 30 In article <8457@bloom-beacon.MIT.EDU> eichin@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 = = SIPB Member & Project Athena ``Watchmaker'' Chet Ramey chet@cwjcc.CWRU.EDU Network Management Group chet@alpha.CES.CWRU.EDU Andrew R. Jennings Computing Center chet@pirate.CWRU.EDU Case Western Reserve University