extras/physfsrwops.c
changeset 1631 1aec60db9326
parent 1630 5123a32160af
--- a/extras/physfsrwops.c	Sat Nov 11 08:53:23 2017 -0500
+++ b/extras/physfsrwops.c	Tue Feb 20 10:26:33 2018 -0500
@@ -70,7 +70,7 @@
         if (current == -1)
         {
             SDL_SetError("Can't find position in file: %s",
-                          PHYSFS_getLastError());
+                          PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
             return -1;
         } /* if */
 
@@ -91,7 +91,7 @@
         const PHYSFS_sint64 len = PHYSFS_fileLength(handle);
         if (len == -1)
         {
-            SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError());
+            SDL_SetError("Can't find end of file: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
             return -1;
         } /* if */
 
@@ -112,7 +112,7 @@
     
     if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
     {
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
         return -1;
     } /* if */
 
@@ -138,7 +138,7 @@
     {
         if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
         {
-            SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+            SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
 
             #if TARGET_SDL2
             return 0;
@@ -167,7 +167,7 @@
     const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size);
     const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen);
     if (rc != ((PHYSFS_sint64) writelen))
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
 
     #if TARGET_SDL2
     return (size_t) rc;
@@ -182,7 +182,7 @@
     PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
     if (!PHYSFS_close(handle))
     {
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
         return -1;
     } /* if */
 
@@ -196,7 +196,7 @@
     SDL_RWops *retval = NULL;
 
     if (handle == NULL)
-        SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
+        SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
     else
     {
         retval = SDL_AllocRW();