Skip to content

Commit

Permalink
Corrected __PHYSFS_platformTell()'s return value to be correct.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 1, 2011
1 parent 8258274 commit 025a02f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/physfs_internal.h
Expand Up @@ -1176,8 +1176,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos);
*
* Not all file types can "tell"; this is to be expected by the caller.
*
* On error, call __PHYSFS_setError() and return zero. On success, return
* a non-zero value.
* On error, call __PHYSFS_setError() and return -1. On success, return >= 0.
*/
PHYSFS_sint64 __PHYSFS_platformTell(void *opaque);

Expand Down
2 changes: 1 addition & 1 deletion src/platform_pocketpc.c
Expand Up @@ -409,7 +409,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
LowPos = SetFilePointer(Handle, 0, &HighPos, FILE_CURRENT);
if ((LowPos == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR))
{
BAIL_MACRO(win32strerror(), 0);
BAIL_MACRO(win32strerror(), -1);
} /* if */
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform_windows.c
Expand Up @@ -1051,7 +1051,7 @@ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
if ( (LowPos == PHYSFS_INVALID_SET_FILE_POINTER) &&
(GetLastError() != NO_ERROR) )
{
BAIL_MACRO(winApiStrError(), 0);
BAIL_MACRO(winApiStrError(), -1);
} /* if */
else
{
Expand Down

0 comments on commit 025a02f

Please sign in to comment.