Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Quick-rejection optimization in __PHYSFS_verifySecurity().
  • Loading branch information
icculus committed Aug 28, 2002
1 parent 0eb5f71 commit b0a63ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions physfs.c
Expand Up @@ -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);
Expand Down

0 comments on commit b0a63ca

Please sign in to comment.