PHYSFS_stat() returns zero on error, not -1.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 07 Feb 2014 16:22:43 -0500
changeset 1344 3862cf505e99
parent 1343 26cfac1a1f6f
child 1345 29ab417d9453
PHYSFS_stat() returns zero on error, not -1.
src/physfs.c
--- a/src/physfs.c	Fri Feb 07 16:22:54 2014 -0500
+++ b/src/physfs.c	Fri Feb 07 16:22:43 2014 -0500
@@ -2813,11 +2813,11 @@
     char *fname;
     size_t len;
 
-    BAIL_IF_MACRO(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, -1);
-    BAIL_IF_MACRO(!stat, PHYSFS_ERR_INVALID_ARGUMENT, -1);
+    BAIL_IF_MACRO(!_fname, PHYSFS_ERR_INVALID_ARGUMENT, 0);
+    BAIL_IF_MACRO(!stat, PHYSFS_ERR_INVALID_ARGUMENT, 0);
     len = strlen(_fname) + 1;
     fname = (char *) __PHYSFS_smallAlloc(len);
-    BAIL_IF_MACRO(!fname, PHYSFS_ERR_OUT_OF_MEMORY, -1);
+    BAIL_IF_MACRO(!fname, PHYSFS_ERR_OUT_OF_MEMORY, 0);
 
     /* set some sane defaults... */
     stat->filesize = -1;