allow calling lammps_last_error_message() with a NULL buffer to clear the error

This commit is contained in:
Axel Kohlmeyer
2023-09-06 00:27:31 -04:00
parent 0b5ce04638
commit 2c0ff19528
2 changed files with 14 additions and 6 deletions

View File

@ -1100,6 +1100,8 @@ void LammpsGui::render_image()
ui->textEdit->setTextCursor(saved);
lammps.command("clear");
lammps.commands_string(selection.toStdString().c_str());
// clear any possible error status
lammps.get_last_error_message(nullptr, 0);
}
// still no system box. bail out with a suitable message
if (!lammps.extract_setting("box_exist")) {