File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ bool Fhex::loadFile(QString path) {
368368 this ->setWindowTitle (" Fhex - " + QString (this ->hexEditor ->getCurrentPath ().c_str ()));
369369 loadBinChart ();
370370 } else {
371- this ->statusBar .setText (" Error while opening " + QString ( this -> hexEditor -> getCurrentPath (). c_str ()) );
371+ this ->statusBar .setText (" Error while opening " + path );
372372 }
373373 return res;
374374}
Original file line number Diff line number Diff line change @@ -9,11 +9,14 @@ int main(int argc, char *argv[])
99 QString filepath = " " ;
1010
1111 if (argc > 1 ) {
12- for (int i = 0 ; i < argc; i++) {
13- if ( QFile::exists ( argv[i])) {
14- filepath = argv[i];
12+ for (int i = 1 ; i < argc; i++) {
13+ filepath = argv[i];
14+ if ( QFile::exists ( filepath)) {
1515 Fhex *window = new Fhex (nullptr , &a, filepath);
1616 window->show ();
17+ } else {
18+ cout << " Error: Cannot load file '" << filepath.toStdString () << " '" << endl;
19+ return 1 ;
1720 }
1821 }
1922 } else {
You can’t perform that action at this time.
0 commit comments