Skip to content

Commit

Permalink
PHYSFS_init() should fail if argv0 is NULL and we can't do without it.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 19, 2007
1 parent 2ce4b64 commit 4530776
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions physfs.c
Expand Up @@ -662,6 +662,9 @@ static char *calculateBaseDir(const char *argv0)
if (retval != NULL)
return(retval);

/* we need argv0 to be sane to go on. */
BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, NULL);

/*
* Determine if there's a path on argv0. If there is, that's the base dir.
*/
Expand All @@ -684,6 +687,8 @@ static char *calculateBaseDir(const char *argv0)
return(retval);
} /* if */

/* !!! FIXME: should probably just fail here instead of being heroic. */

/*
* Last ditch effort: it's the current working directory. (*shrug*)
*/
Expand Down

0 comments on commit 4530776

Please sign in to comment.