Skip to content

Commit

Permalink
Mac Classic platform layer: don't strcmp() a NULL string.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 14, 2007
1 parent 5908057 commit 31ff24a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions platform/macclassic.c
Expand Up @@ -124,15 +124,16 @@ static OSErr oserr(OSErr retval)
{
char buf[sizeof (ERR_MACOS_GENERIC) + 32];
const char *errstr = get_macos_error_string(retval);
if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
if (errstr != NULL)
{
sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
errstr = buf;
} /* if */
if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
{
sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
errstr = buf;
} /* if */

if (errstr != NULL)
__PHYSFS_setError(errstr);

} /* if */
return(retval);
} /* oserr */

Expand Down

0 comments on commit 31ff24a

Please sign in to comment.