Skip to content

Commit

Permalink
PHYSFS_stat() returns zero on error, not -1.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 7, 2014
1 parent 8e065c0 commit 0163940
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/physfs.c
Expand Up @@ -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;
Expand Down

0 comments on commit 0163940

Please sign in to comment.