Skip to content
Permalink
Browse files
PHYSFS_stat() returns zero on error, not -1.
  • Loading branch information
icculus committed Feb 7, 2014
1 parent 8e065c0 commit 016394067c02064333ca9664bee8f7605cd8a3cb
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/physfs.c
@@ -2813,11 +2813,11 @@ int PHYSFS_stat(const char *_fname, PHYSFS_Stat *stat)
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;

0 comments on commit 0163940

Please sign in to comment.