diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-10 18:07:51 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-10 18:07:51 -0700 |
commit | d119ce6f9a354d705396f06f86d00532836f3883 (patch) | |
tree | 1a4ba20a0348ba8dfe369653c33d00f78cd62d6b /nasmlib.c | |
parent | 6867acc18ee541e361a5fa1e5a1bac3a478a3856 (diff) | |
download | nasm-d119ce6f9a354d705396f06f86d00532836f3883.tar.gz nasm-d119ce6f9a354d705396f06f86d00532836f3883.tar.bz2 nasm-d119ce6f9a354d705396f06f86d00532836f3883.zip |
saa_fread/fwrite: when seeking, must set [rw]ptr as well
[rw]ptr represent the global position and need to be kept in sync with
[rw]pos:[rw]blk at all times. Failed to do that while seeking, with
obviously bad results.
Diffstat (limited to 'nasmlib.c')
-rw-r--r-- | nasmlib.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -692,6 +692,7 @@ void saa_fread(struct SAA *s, size_t posn, void *data, size_t len) } ix = posn / s->blk_len; + s->rptr = posn; s->rpos = posn % s->blk_len; s->rblk = &s->blk_ptrs[ix]; @@ -710,6 +711,7 @@ void saa_fwrite(struct SAA *s, size_t posn, const void *data, size_t len) } ix = posn / s->blk_len; + s->wptr = posn; s->wpos = posn % s->blk_len; s->wblk = &s->blk_ptrs[ix]; |