Fix exit() calls in CutterApplication constructor

This commit is contained in:
Florian Märkl 2018-10-21 18:23:35 +02:00
parent addaf40e5e
commit 4167b3828f

View File

@ -18,6 +18,8 @@
#include "CutterConfig.h" #include "CutterConfig.h"
#include <cstdlib>
CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv) CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv)
{ {
setOrganizationName("Cutter"); setOrganizationName("Cutter");
@ -70,8 +72,9 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
msg.setText(QString( msg.setText(QString(
QObject::tr("The version used to compile Cutter (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg( QObject::tr("The version used to compile Cutter (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg(
localVersion, r2version)); localVersion, r2version));
if (msg.exec() == QMessageBox::No) if (msg.exec() == QMessageBox::No) {
exit(1); std::exit(1);
}
} }
#ifdef CUTTER_ENABLE_JUPYTER #ifdef CUTTER_ENABLE_JUPYTER
@ -92,7 +95,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
if (!analLevelSpecified || analLevel < 0 || analLevel > 2) { if (!analLevelSpecified || analLevel < 0 || analLevel > 2) {
printf("%s\n", printf("%s\n",
QObject::tr("Invalid Analysis Level. May be a value between 0 and 2.").toLocal8Bit().constData()); QObject::tr("Invalid Analysis Level. May be a value between 0 and 2.").toLocal8Bit().constData());
exit(1); std::exit(1);
} }
} }
@ -103,7 +106,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
if (analLevelSpecified) { if (analLevelSpecified) {
printf("%s\n", printf("%s\n",
QObject::tr("Filename must be specified to start analysis automatically.").toLocal8Bit().constData()); QObject::tr("Filename must be specified to start analysis automatically.").toLocal8Bit().constData());
exit(1); std::exit(1);
} }
mainWindow->displayNewFileDialog(); mainWindow->displayNewFileDialog();