From 569f7d15d1992a437ad48a881feb62ec80d936bd Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 20 Jan 2016 16:59:55 -0600 Subject: [PATCH] Efficiency improvement in whitelist check Thanks Inu! --- src/blua/liolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blua/liolib.c b/src/blua/liolib.c index d2303415..6dd87704 100644 --- a/src/blua/liolib.c +++ b/src/blua/liolib.c @@ -158,7 +158,7 @@ static int io_open (lua_State *L) { const char *filename = luaL_checkstring(L, 1); int pass = 0; int i; int length = strlen(filename) - 1; - for (i = 0; i < 5; i++) // wolfs == noobcoder, so manually change this with any added file types + for (i = 0; i < (sizeof (whitelist) / sizeof(const char *)); i++) { if (!stricmp(&filename[length - (strlen(whitelist[i]) - 1)], whitelist[i])) {