Quick-rejection optimization in __PHYSFS_verifySecurity().
authorRyan C. Gordon <icculus@icculus.org>
Wed, 28 Aug 2002 23:27:10 +0000
changeset 481 c2c8d56ec65c
parent 480 2cf0b6edd200
child 482 4b6062ed9380
Quick-rejection optimization in __PHYSFS_verifySecurity().
physfs.c
--- a/physfs.c	Wed Aug 28 08:58:39 2002 +0000
+++ b/physfs.c	Wed Aug 28 23:27:10 2002 +0000
@@ -1200,6 +1200,9 @@
     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);