From 4dcd756f33112dbe4f780a26953cd3fea739e87f Mon Sep 17 00:00:00 2001 From: kpl Date: Sat, 1 Feb 2014 16:27:13 -0800 Subject: [PATCH] cmFile.c : Fixed potential uninitialized variable in cmFiileBackup(). --- cmFile.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmFile.c b/cmFile.c index f292e5b..e126c26 100644 --- a/cmFile.c +++ b/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 rc = kOkFileRC; - cmChar_t* newName = NULL; - const cmChar_t* newFn = NULL; - unsigned n = 0; - const cmChar_t* srcFn = NULL; + cmFileRC_t rc = kOkFileRC; + cmChar_t* newName = NULL; + const cmChar_t* newFn = NULL; + unsigned n = 0; + const cmChar_t* srcFn = NULL; + cmFileSysPathPart_t* pp = NULL; // form the name of the backup file 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; // break the source file name up into dir/fn/ext. - cmFileSysPathPart_t* pp = 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));