diff options
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 12a63b0..aa39c39 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -406,11 +406,12 @@ bool cmSystemTools::IsNOTFOUND(const char* val) bool cmSystemTools::IsOff(const char* val) { - if (!val || strlen(val) == 0) + if (!val || !*val) { return true; } - std::basic_string<char> v = val; + size_t len = val ? strlen(val) : 0; + std::basic_string<char> v(val, len); for(std::basic_string<char>::iterator c = v.begin(); c != v.end(); c++) |