From 121fa374a9f7361dfc6b0c726943251da7df4d71 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Mon, 27 Jun 2005 15:59:16 -0400 Subject: [PATCH] BUG: dont pass unverified char * to streams --- Source/cmMakefile.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ba57c3e5b..6eeefca82 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1401,8 +1401,10 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, { cmOStringStream error; error << "Syntax error in cmake code at\n" - << filename << ":" << line << ":\n" - << parser.GetError() << ", when parsing string \"" << source.c_str() << "\""; + << (filename?filename:"(no filename given)") + << ":" << line << ":\n" + << parser.GetError() << ", when parsing string \"" + << source.c_str() << "\""; const char* versionValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); int major = 0;