Mac Classic platform layer: don't strcmp() a NULL string.

This commit is contained in:
Ryan C. Gordon 2007-03-14 06:39:17 +00:00
parent 5908057d71
commit 31ff24a38f
1 changed files with 8 additions and 7 deletions

View File

@ -124,15 +124,16 @@ static OSErr oserr(OSErr retval)
{ {
char buf[sizeof (ERR_MACOS_GENERIC) + 32]; char buf[sizeof (ERR_MACOS_GENERIC) + 32];
const char *errstr = get_macos_error_string(retval); const char *errstr = get_macos_error_string(retval);
if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
{
sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
errstr = buf;
} /* if */
if (errstr != NULL) if (errstr != NULL)
__PHYSFS_setError(errstr); {
if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
{
sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
errstr = buf;
} /* if */
__PHYSFS_setError(errstr);
} /* if */
return(retval); return(retval);
} /* oserr */ } /* oserr */