Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!nrl-cmf!ukma!gatech!udel!rochester!uhura.cc.rochester.edu!ur-valhalla!micropen!dave From: dave@micropen (David F. Carlson) Newsgroups: comp.unix.aux Subject: Re: fprintf() weirdness? Summary: check your code again Keywords: portability fprintf core Message-ID: <592@micropen> Date: 15 Dec 88 17:21:58 GMT References: <8457@bloom-beacon.MIT.EDU> Organization: Micropen Dirent Writing Systems, Pittsford, NY Lines: 22 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 > 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); > Mark Eichin Regardless of why the fputs works correctly (g*d only knows why), you should not make use of *writing* to a FILE * that you show you opened for *read* only. Yes, you have a non-NULL FILE * but it is not correct to write to it. inews fodder inews fodder inews fodder inews fodder inews fodder -- David F. Carlson, Micropen, Inc. micropen!dave@ee.rochester.edu "The faster I go, the behinder I get." --Lewis Carroll