do not ignore the return value of system(cmd) anymore.

This commit is contained in:
2022-04-11 16:10:00 +02:00
parent 9cc1957b2d
commit 17a31dfcc4
6 changed files with 45 additions and 11 deletions

View File

@ -574,10 +574,16 @@ bool msr2msr_finalize_theory(char *fln, int theoryTag, int noOfAddionalParams)
// cp __temp.msr fln
sprintf(str, "cp __temp.msr %s", fln);
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return false;
}
// rm __temp.msr
strcpy(str, "rm __temp.msr");
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return false;
}
return true;
}
@ -704,7 +710,10 @@ int main(int argc, char *argv[])
// check if conversion seems to be OK
if (!success) {
sprintf(str, "rm -rf %s", argv[2]);
system(str);
if (system(str) == -1) {
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
return 0;
}
}
if (theoryTag != -1) {