www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/07/31/08:38:45

Message-ID: <3D479194.3998CB1B@acm.org>
From: Eric Sosman <esosman AT acm DOT org>
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: fread can't read a second time.
References: <ai5bds$2q0$1 AT news5 DOT jaring DOT my>
Lines: 16
Date: Wed, 31 Jul 2002 12:26:55 GMT
NNTP-Posting-Host: 12.91.2.70
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1028118415 12.91.2.70 (Wed, 31 Jul 2002 12:26:55 GMT)
NNTP-Posting-Date: Wed, 31 Jul 2002 12:26:55 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Patrick Chen wrote:
> [...]
>    When I put the second block to process the green.bmp,
> SIGSEGV general protection fault occur at the fread of the second block.

    Are you sure the second fopen() succeeds?  Notice that
the program does *not* check for its success or failure:

> fin2=fopen("green.bmp","rb");
  ^^^^
>     if(fin==NULL)
         ^^^

-- 
Eric Sosman
esosman AT acm DOT org

- Raw text -


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