File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1126,7 +1126,16 @@ void Fhex::saveDataToFile(string path, bool loadfile) {
11261126 this ->hexEditor ->getCurrentData ().clear ();
11271127 this ->hexEditor ->getCurrentData ().shrink_to_fit ();
11281128 // Now copy data from the front-end
1129- this ->hexEditor ->getCurrentData ().insert (this ->hexEditor ->getCurrentData ().begin (), this ->qhex ->data ().begin (), this ->qhex ->data ().end ());
1129+ try {
1130+ for (const char c : this ->qhex ->data ()) {
1131+ this ->hexEditor ->getCurrentData ().push_back (uint8_t (c));
1132+ }
1133+ } catch (const exception &e) {
1134+ this ->statusBar .setText (" SAVE ERROR! " + QString (e.what ()));
1135+ return ;
1136+ }
1137+
1138+ //
11301139 // Update the size, the user could have added/removed bytes
11311140 long diffbytes = this ->hexEditor ->getCurrentData ().size () - this ->hexEditor ->loadedFileSize ;
11321141 this ->hexEditor ->loadedFileSize = this ->hexEditor ->getCurrentData ().size ();
Original file line number Diff line number Diff line change 4848#include < chrono>
4949#include < thread>
5050#include < future>
51+ #include < algorithm>
5152
5253#include " core/json.h"
5354
@@ -78,7 +79,7 @@ class Fhex : public QMainWindow
7879
7980private:
8081 // RELEASE VERSION
81- string version = " 3.0.4 " ;
82+ string version = " 3.0.5 " ;
8283
8384 // JSON
8485 json jconfig;
You can’t perform that action at this time.
0 commit comments