]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
The test used in the FS_Read function to detect the end of a compressed file was...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Feb 2004 09:26:45 +0000 (09:26 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Feb 2004 09:26:45 +0000 (09:26 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3883 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index b8fd9a615a01297c5512418de3ecd393917dc414..2a5ea5a867f3cdbcc5fd4456ba42a42ef3a42593 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1344,12 +1344,13 @@ size_t FS_Read (qfile_t* file, void* buffer, size_t buffersize)
                // If "input" is also empty, we need to fill it
                if (ztk->in_ind == ztk->in_max)
                {
-                       size_t remain = file->length - ztk->in_position;
+                       size_t remain;
 
                        // If we are at the end of the file
-                       if (!remain)
+                       if (ztk->out_position == ztk->real_length)
                                return nb;
 
+                       remain = file->length - ztk->in_position;
                        count = (remain > sizeof (ztk->input)) ? sizeof (ztk->input) : remain;
                        fread (ztk->input, 1, count, file->stream);