From 68fee04f368e8b3d33968704818bd1a5a80f500f Mon Sep 17 00:00:00 2001 From: black Date: Mon, 28 Jan 2008 01:09:00 +0000 Subject: [PATCH] Clean up the FS_FIX_PATHS code a bit - should by faster now, too. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8029 d7cf8633-e32d-0410-b094-e92efae38249 --- fs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs.c b/fs.c index 8571aed1..d824e07f 100644 --- a/fs.c +++ b/fs.c @@ -1821,14 +1821,12 @@ qfile_t* FS_Open (const char* filepath, const char* mode, qboolean quiet, qboole { #ifdef FS_FIX_PATHS char fixedFileName[MAX_QPATH]; - char *d = fixedFileName; + char *d; + strlcpy( fixedFileName, filepath, MAX_QPATH ); // try to fix common mistakes (\ instead of /) - for( ; *filepath ; filepath++, d++ ) - if( *filepath != '\\' ) - *d = *filepath; - else + for( d = fixedFileName ; *d ; d++ ) + if( *d == '\\' ) *d = '/'; - *d = '\0'; filepath = fixedFileName; #endif -- 2.39.2