From ccf1338d41532a0a489cc112768570d0dca75631 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 18 Jul 2009 09:35:38 +0000 Subject: [PATCH] Check bounds before, not after. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3297 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/engine/common/common.c b/engine/common/common.c index a91bc540c..37cb38eb3 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -1576,12 +1576,9 @@ void COM_FileBase (const char *in, char *out, int outlen) while (s > in && *s != '.') s--; - for (s2 = s ; *s2 && *s2 != '/' ; s2--) + for (s2 = s ; s2 > in && *s2 && *s2 != '/' ; s2--) ; - if (in > s2) - s2 = in; - if (s-s2 < 2) { if (s == s2)