mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
fix usage of realpath
This commit is contained in:
parent
5295644ba4
commit
ddbaf03d72
1 changed files with 6 additions and 2 deletions
|
@ -54,9 +54,13 @@ bool radCopyFile( const char *lpExistingFileName, const char *lpNewFileName, boo
|
|||
int l;
|
||||
bool ret = false;
|
||||
char realsrc[PATH_MAX], realdest[PATH_MAX];
|
||||
memset( realsrc, 0, sizeof(realsrc) );
|
||||
memset( realdest, 0, sizeof(realdest) );
|
||||
|
||||
realpath( lpExistingFileName, realsrc );
|
||||
realpath( lpNewFileName, realdest );
|
||||
if ( realpath( lpExistingFileName, realsrc ) == nullptr )
|
||||
strncpy( realsrc, lpExistingFileName, sizeof(realsrc) - 1 );
|
||||
if ( realpath( lpNewFileName, realdest ) == nullptr )
|
||||
strncpy( realdest, lpNewFileName, sizeof(realdest) - 1 );
|
||||
|
||||
src = fopen( realsrc, "rb" );
|
||||
if ( !src ) {
|
||||
|
|
Loading…
Reference in a new issue