From: black Date: Mon, 28 Jan 2008 01:09:00 +0000 (+0000) Subject: Clean up the FS_FIX_PATHS code a bit - should by faster now, too. X-Git-Tag: xonotic-v0.1.0preview~2485 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68fee04f368e8b3d33968704818bd1a5a80f500f;p=xonotic%2Fdarkplaces.git 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 --- 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