From f7c4eab99a057c5a011696435c979f263f61bce3 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 23 Jul 2003 05:48:36 +0000 Subject: [PATCH] update raw pointer in cfwrite --- ChangeLog | 4 ++++ cfile/cfile.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b62e2c80..ed8fb159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-07-15 Martin Schaffner + + * cfile/cfile.c: update raw pointer in cfwrite + 2003-06-22 Bradley Bell * cfile/cfile.c: use standard fgets for non-archive files diff --git a/cfile/cfile.c b/cfile/cfile.c index df27c308..42479d2f 100644 --- a/cfile/cfile.c +++ b/cfile/cfile.c @@ -1,4 +1,4 @@ -/* $Id: cfile.c,v 1.13 2003-06-22 23:06:00 btb Exp $ */ +/* $Id: cfile.c,v 1.14 2003-07-23 05:48:36 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -551,6 +551,8 @@ int cfilelength( CFILE *fp ) // int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile) { + int items_written; + Assert(cfile != NULL); Assert(buf != NULL); Assert(elsize > 0); @@ -558,7 +560,12 @@ int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile) Assert(cfile->file != NULL); Assert(cfile->lib_offset == 0); - return fwrite(buf, elsize, nelem, cfile->file); + items_written = fwrite(buf, elsize, nelem, cfile->file); + + cfile->raw_position += items_written; + Assert(cfile->raw_position == ftell(cfile->file)); + + return items_written; } -- 2.39.2