From d4bc0a6bb5b4331e7cea9f67a0e7e6501b2f1646 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 16 Dec 2003 15:59:21 +0000 Subject: [PATCH] fix a filesystem directory listing bug in FS_Search git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3736 d7cf8633-e32d-0410-b094-e92efae38249 --- fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs.c b/fs.c index 3143e7ba..beddbec6 100644 --- a/fs.c +++ b/fs.c @@ -1939,8 +1939,7 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet) { for (dirfile = dir;dirfile;dirfile = dirfile->next) { - memcpy(temp, basepath, basepathlength); - strcpy(temp + basepathlength, dirfile->text); + snprintf(temp, sizeof(temp), "%s/%s", basepath, dirfile->text); if (matchpattern(temp, (char *)pattern, true)) { for (listtemp = liststart;listtemp;listtemp = listtemp->next) -- 2.39.2