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;
|
int l;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
char realsrc[PATH_MAX], realdest[PATH_MAX];
|
char realsrc[PATH_MAX], realdest[PATH_MAX];
|
||||||
|
memset( realsrc, 0, sizeof(realsrc) );
|
||||||
|
memset( realdest, 0, sizeof(realdest) );
|
||||||
|
|
||||||
realpath( lpExistingFileName, realsrc );
|
if ( realpath( lpExistingFileName, realsrc ) == nullptr )
|
||||||
realpath( lpNewFileName, realdest );
|
strncpy( realsrc, lpExistingFileName, sizeof(realsrc) - 1 );
|
||||||
|
if ( realpath( lpNewFileName, realdest ) == nullptr )
|
||||||
|
strncpy( realdest, lpNewFileName, sizeof(realdest) - 1 );
|
||||||
|
|
||||||
src = fopen( realsrc, "rb" );
|
src = fopen( realsrc, "rb" );
|
||||||
if ( !src ) {
|
if ( !src ) {
|
||||||
|
|
Loading…
Reference in a new issue