From 025a02f4c02bdffcf3269957a6f7f192cdc135a2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 1 Aug 2011 17:56:30 -0400 Subject: [PATCH] Corrected __PHYSFS_platformTell()'s return value to be correct. --- src/physfs_internal.h | 3 +-- src/platform_pocketpc.c | 2 +- src/platform_windows.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/physfs_internal.h b/src/physfs_internal.h index b3139ad2..f33551a3 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -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); diff --git a/src/platform_pocketpc.c b/src/platform_pocketpc.c index 7d8607c7..81f91c2e 100644 --- a/src/platform_pocketpc.c +++ b/src/platform_pocketpc.c @@ -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 { diff --git a/src/platform_windows.c b/src/platform_windows.c index d1512908..aa256905 100644 --- a/src/platform_windows.c +++ b/src/platform_windows.c @@ -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 {