Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Fread problem |
| Date | 19 Jul 2011 17:21:09 GMT |
| Organization | None |
| Lines | 42 |
| Message-ID | <98lso4FgvmU3@mid.individual.net> (permalink) |
| References | <ivq9i7$841$1@speranza.aioe.org> <87d3har2zu.fsf@temporary-address.org.uk> <ivss0p$ulb$1@speranza.aioe.org> <ln7h7foaac.fsf@nuthaus.mib.org> |
| X-Trace | individual.net yg5w1XheUn9eNcTFXwoM3Q5bQy0Y0eWt6z4Phe98FQpFembphm |
| X-Orig-Path | not-for-mail |
| Cancel-Lock | sha1:de+aB/fb0yPwyLwc1GsoRtETs/M= |
| X-Newsreader | trn 4.0-test76 (Apr 2, 2001) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c:8492 |
Show key headers only | View raw
In article <ln7h7foaac.fsf@nuthaus.mib.org>, Keith Thompson <kst-u@mib.org> wrote: > Jack <spamtrap@trashcan.invalid> writes: > [...] > > Thanks for your help. I think I've now found a solution. > > > > After the file is first Fopen'd, I make a backup of the internal buffers. > > fp=Fopen(...); > > FILE fback; > > memcpy(&fback,fp,sizeof(FILE)); > > > > then before the fread I restore this buffer, > > memcpy(fp,&fback,sizeof(FILE)); > > Fread(...,fp); > > > > Now there is no segmentation fault, job done. > > That's actually a reasonable first step in tracking down the real > problem. > > If I were working on this, I might do the following. > > First, change Fopen and Fread to fopen and fread, respectively. I'm mildly curious about that (why the capital letters) myself. I'm speculating that perhaps the original code used fopen and fread, but somehow between there and the newsgroup post some tool that "helps" by capitalizing letters was involved. I'm reminded of the occasion, some years ago, when I received code from a student in the form of a Word document (which apparently had been created with all Word's default auto-correct stuff turned on). You can all probably imagine .... Maybe the OP will explain. Or not, given the direction of subsequent discussion. [ snip ] -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Fread problem Jack <spamtrap@trashcan.invalid> - 2011-07-15 20:56 +0000
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-16 09:05 +1200
Re: Fread problem Noob <root@127.0.0.1> - 2011-07-19 13:41 +0200
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-15 21:43 +0000
Re: Fread problem Jack <spamtrap@trashcan.invalid> - 2011-07-16 09:22 +0000
Re: Fread problem Dr Nick <3-nospam@temporary-address.org.uk> - 2011-07-16 10:25 +0100
Re: Fread problem Jack <spamtrap@trashcan.invalid> - 2011-07-16 20:23 +0000
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-17 08:37 +1200
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-16 20:46 +0000
Re: Fread problem James Kuyper <jameskuyper@verizon.net> - 2011-07-16 18:29 -0400
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-16 23:14 +0000
Re: Fread problem Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-16 16:55 -0400
Re: Fread problem blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-19 17:17 +0000
[OT] Re: Fread problem Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-19 20:11 -0400
Re: [OT] Re: Fread problem Seebs <usenet-nospam@seebs.net> - 2011-07-20 02:27 +0000
Re: Fread problem Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-16 14:57 -0600
Re: Fread problem Jack <spamtrap@trashcan.invalid> - 2011-07-17 20:45 +0000
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-18 08:50 +1200
Re: Fread problem James Kuyper <jameskuyper@verizon.net> - 2011-07-17 17:06 -0400
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-18 09:09 +1200
Re: Fread problem Hans Vlems <hvlems@freenet.de> - 2011-07-18 13:01 -0700
Re: Fread problem Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-17 16:06 -0600
Re: Fread problem Geoff <geoff@invalid.invalid> - 2011-07-17 17:56 -0700
Re: Fread problem Seebs <usenet-nospam@seebs.net> - 2011-07-18 04:08 +0000
Re: Fread problem Geoff <geoff@invalid.invalid> - 2011-07-17 22:08 -0700
Re: Fread problem Jack <spamtrap@trashcan.invalid> - 2011-07-18 20:20 +0000
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-19 08:50 +1200
Re: Fread problem Cat 22 <cat22@invalid.org> - 2011-07-18 18:34 -0700
Re: Fread problem James Kuyper <jameskuyper@verizon.net> - 2011-07-19 07:19 -0400
Re: Fread problem Stephen Sprunk <stephen@sprunk.org> - 2011-07-19 09:31 -0500
Re: Fread problem Todd Carnes <toddcarnes@gmail.com> - 2011-07-18 04:23 +0000
Re: Fread problem Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-07-18 01:15 -0700
Re: Fread problem Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-18 07:22 -0400
Re: Fread problem Kenneth Brody <kenbrody@spamcop.net> - 2011-07-18 13:56 -0400
Re: Fread problem Kenneth Brody <kenbrody@spamcop.net> - 2011-07-18 13:49 -0400
Re: Fread problem Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-18 20:31 -0400
Re: Fread problem Squeamizh <squeamz@hotmail.com> - 2011-07-18 21:11 -0700
Re: Fread problem blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-19 17:19 +0000
Re: Fread problem Kenneth Brody <kenbrody@spamcop.net> - 2011-07-19 14:18 -0400
Re: Fread problem pete <pfiland@mindspring.com> - 2011-07-19 15:19 -0400
Re: Fread problem blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-19 21:33 +0000
Re: Fread problem Geoff <geoff@invalid.invalid> - 2011-07-16 14:27 -0700
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-16 22:22 +0000
Re: Fread problem "Kleuskes & Moos" <kleuske@xs4all.nl> - 2011-07-16 23:28 -0700
Re: Fread problem "J. J. Farrell" <jjf@bcs.org.uk> - 2011-07-18 04:58 +0100
Re: Fread problem Keith Thompson <kst-u@mib.org> - 2011-07-18 08:53 -0700
Re: Fread problem Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-07-18 18:07 +0100
Re: Fread problem Keith Thompson <kst-u@mib.org> - 2011-07-18 12:50 -0700
Re: Fread problem Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-18 12:18 -0600
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-18 20:18 +0000
Re: Fread problem Keith Thompson <kst-u@mib.org> - 2011-07-18 13:28 -0700
Re: Fread problem Lew Pitcher <lpitcher@teksavvy.com> - 2011-07-18 16:55 -0400
Re: Fread problem Anders Wegge Keller <wegge@wegge.dk> - 2011-07-18 22:51 +0200
Re: Fread problem blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-19 17:21 +0000
Re: Fread problem Kenneth Brody <kenbrody@spamcop.net> - 2011-07-18 13:44 -0400
Re: Fread problem Ian Collins <ian-news@hotmail.com> - 2011-07-16 21:39 +1200
Re: Fread problem Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-16 12:18 -0600
Re: Fread problem John Gordon <gordon@panix.com> - 2011-07-16 19:36 +0000
csiph-web