Fix comment stripping in sender

This commit is contained in:
Alessandro Ranellucci 2015-12-06 11:17:58 +01:00
parent 27dcd60c77
commit 954e2c9bf0

View file

@ -403,8 +403,9 @@ GCodeSender::do_send()
} }
// strip comments // strip comments
if (size_t comment_pos = line.find_first_of(';') != std::string::npos) size_t comment_pos = line.find_first_of(';');
line.erase(comment_pos, std::string::npos); if (comment_pos != std::string::npos)
line.erase(comment_pos, std::string::npos);
boost::algorithm::trim(line); boost::algorithm::trim(line);
// if line is not empty, send it // if line is not empty, send it