From 3435a3cc00e8c5887243d073d9e77e5e0ec2532c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 25 Sep 2017 16:32:52 -0400 Subject: [PATCH] Fixed seeking within read buffers. --- src/physfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physfs.c b/src/physfs.c index e18be8e..9ea904b 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -2889,7 +2889,7 @@ int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos) /* backward? */ ((offset < 0) && (((size_t) -offset) <= fh->bufpos)) ) { - fh->bufpos += (PHYSFS_uint32) offset; + fh->bufpos = (size_t) (((PHYSFS_sint64) fh->bufpos) + offset); return 1; /* successful seek */ } /* if */ } /* if */