delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/17:02:05

From: pneyz <pneyz AT bethany DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Error Writing to File
Date: Wed, 10 Dec 1997 15:17:23 -0800
Organization: Smoof Team
Lines: 17
Message-ID: <348F2303.1CCE54B2@bethany.edu>
References: <348EFB98 DOT 25F8 AT epix DOT net>
NNTP-Posting-Host: scz-ca5-15.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> while(!feof(in))
> {
>  fprintf(in, "0");
> }
> 
> fclose(in);

Try using fputc('\0',in); instead. The only thing I could see causing it
would be the fprintf statement. You might also want to change the while
statement to:

   while (!feof(in) && !ferror(in))

That way it also checks for file errors.

				pneyz[smoof.ganja]
				"Fine Malt Coding"

- Raw text -


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