Quick-rejection optimization in __PHYSFS_verifySecurity().

This commit is contained in:
Ryan C. Gordon 2002-08-28 23:27:10 +00:00
parent 0eb5f71880
commit b0a63caf40
1 changed files with 3 additions and 0 deletions

View File

@ -1200,6 +1200,9 @@ int __PHYSFS_verifySecurity(DirHandle *h, const char *fname)
char *end;
char *str;
if (*fname == '\0') /* quick rejection. */
return(1);
/* !!! FIXME: Can we ditch this malloc()? */
start = str = malloc(strlen(fname) + 1);
BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, 0);