diff --git a/src/converters/CKParser.cpp b/src/converters/CKParser.cpp index 177e4aea2..afa97e6e5 100644 --- a/src/converters/CKParser.cpp +++ b/src/converters/CKParser.cpp @@ -370,7 +370,7 @@ void CKParser::getCKLine(std::string& s, std::string& comment) string::size_type icom = line.find(commentChar); // lines that begin with !% are not comments for Cantera - if (icom == 0 && line[1] == undoCommentChar) { + if (icom == 0 && line.size() > 1 && line[1] == undoCommentChar) { line[0] = '%'; line[1] = ' '; icom = line.find(commentChar); diff --git a/src/converters/ck2ct.cpp b/src/converters/ck2ct.cpp index 6e79be5f3..3915c5920 100644 --- a/src/converters/ck2ct.cpp +++ b/src/converters/ck2ct.cpp @@ -74,7 +74,7 @@ static void getTransportData(string trfile) * can't possibly have enough data in them to comprise a * properly formatted record. */ - if (rest[0] != '#' && rest[0] != '!' && rest.size() > 5) { + if (rest.size() > 5 && rest[0] != '#' && rest[0] != '!') { /* * copy the string into a stringstream and parse the line * into the trdata object