[commit] r2161 - Fix sqFileAtEnd logic to test if the file position is >= file size instead of ==.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2161 - Fix sqFileAtEnd logic to test if the file position is >= file size instead of ==.

commits-3
 
Author: andreas
Date: 2010-04-01 12:10:46 -0700 (Thu, 01 Apr 2010)
New Revision: 2161

Modified:
   trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
Log:
Fix sqFileAtEnd logic to test if the file position is >= file size instead of ==.

Modified: trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
===================================================================
--- trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2010-04-01 19:09:26 UTC (rev 2160)
+++ trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2010-04-01 19:10:46 UTC (rev 2161)
@@ -114,7 +114,7 @@
  /* Return true if the file's read/write head is at the end of the file. */
 
  if (!sqFileValid(f)) return interpreterProxy->success(false);
- return ftell(getFile(f)) == getSize(f);
+ return ftell(getFile(f)) >= getSize(f);
 }
 
 sqInt sqFileClose(SQFile *f) {