cmFile.c : Fixed potential uninitialized variable in cmFiileBackup().
This commit is contained in:
parent
c7e3f55a2d
commit
4dcd756f33
12
cmFile.c
12
cmFile.c
@ -423,11 +423,12 @@ cmFileRC_t cmFileCopy(
|
|||||||
|
|
||||||
cmFileRC_t cmFileBackup( const cmChar_t* dir, const cmChar_t* name, const cmChar_t* ext, cmErr_t* err )
|
cmFileRC_t cmFileBackup( const cmChar_t* dir, const cmChar_t* name, const cmChar_t* ext, cmErr_t* err )
|
||||||
{
|
{
|
||||||
cmFileRC_t rc = kOkFileRC;
|
cmFileRC_t rc = kOkFileRC;
|
||||||
cmChar_t* newName = NULL;
|
cmChar_t* newName = NULL;
|
||||||
const cmChar_t* newFn = NULL;
|
const cmChar_t* newFn = NULL;
|
||||||
unsigned n = 0;
|
unsigned n = 0;
|
||||||
const cmChar_t* srcFn = NULL;
|
const cmChar_t* srcFn = NULL;
|
||||||
|
cmFileSysPathPart_t* pp = NULL;
|
||||||
|
|
||||||
// form the name of the backup file
|
// form the name of the backup file
|
||||||
if((srcFn = cmFsMakeFn(dir,name,ext,NULL)) == NULL )
|
if((srcFn = cmFsMakeFn(dir,name,ext,NULL)) == NULL )
|
||||||
@ -441,7 +442,6 @@ cmFileRC_t cmFileBackup( const cmChar_t* dir, const cmChar_t* name, const cmChar
|
|||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
// break the source file name up into dir/fn/ext.
|
// break the source file name up into dir/fn/ext.
|
||||||
cmFileSysPathPart_t* pp = NULL;
|
|
||||||
if((pp = cmFsPathParts(srcFn)) == NULL || pp->fnStr==NULL)
|
if((pp = cmFsPathParts(srcFn)) == NULL || pp->fnStr==NULL)
|
||||||
{
|
{
|
||||||
rc = cmErrMsg(err,kFileSysFailFileRC,"The file name '%s' could not be parsed into its parts.",cmStringNullGuard(srcFn));
|
rc = cmErrMsg(err,kFileSysFailFileRC,"The file name '%s' could not be parsed into its parts.",cmStringNullGuard(srcFn));
|
||||||
|
Loading…
Reference in New Issue
Block a user