summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackPackageMakerGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-10-30 16:22:48 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-10-30 16:22:48 (GMT)
commit7aef92391b4ec5a23efbe03723a19dbeba8f71db (patch)
treed358ff55c2dcbf97986818fbf9d9ea4b302c13cc /Source/CPack/cmCPackPackageMakerGenerator.cxx
parent4400842135799bee8bff35ce455ef3d88680d640 (diff)
downloadCMake-7aef92391b4ec5a23efbe03723a19dbeba8f71db.zip
CMake-7aef92391b4ec5a23efbe03723a19dbeba8f71db.tar.gz
CMake-7aef92391b4ec5a23efbe03723a19dbeba8f71db.tar.bz2
ENH: make sure null const char* is not put into ossttringstream to avoid seg faults
Diffstat (limited to 'Source/CPack/cmCPackPackageMakerGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 2413000..95c1e1d 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -236,14 +236,17 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name)
if ( !inFileName )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
- << " not specified. It should point to " << name << ".rtf, " << name
- << ".html, or " << name << ".txt file" << std::endl);
+ << " not specified. It should point to "
+ << (name ? name : "(NULL)")
+ << ".rtf, " << name
+ << ".html, or " << name << ".txt file" << std::endl);
return false;
}
if ( !cmSystemTools::FileExists(inFileName) )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " << name
- << " resource file: " << inFileName << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
+ << (name ? name : "(NULL)")
+ << " resource file: " << inFileName << std::endl);
return false;
}
std::string ext = cmSystemTools::GetFilenameLastExtension(inFileName);
@@ -260,8 +263,9 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name)
destFileName += name + ext;
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << inFileName
- << " to " << destFileName.c_str() << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
+ << (inFileName ? inFileName : "(NULL)")
+ << " to " << destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
return true;
}