Skip to content
Permalink
Browse files
Quick-rejection optimization in __PHYSFS_verifySecurity().
  • Loading branch information
icculus committed Aug 28, 2002
1 parent 0eb5f71 commit b0a63caf40a058cb2a2e098d92f9195b6f9aa15e
Showing with 3 additions and 0 deletions.
  1. +3 −0 physfs.c
@@ -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);

0 comments on commit b0a63ca

Please sign in to comment.