Fixed seeking within read buffers.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 25 Sep 2017 16:32:52 -0400
changeset 1605 5c5f95f1d5ff
parent 1604 1cfcdfa86341
child 1606 4b3c2995ce0f
Fixed seeking within read buffers.
src/physfs.c
--- a/src/physfs.c	Mon Sep 25 16:19:59 2017 -0400
+++ b/src/physfs.c	Mon Sep 25 16:32:52 2017 -0400
@@ -2889,7 +2889,7 @@
             /* 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 */