File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 10
10
void convert (const std::string& path) {
11
11
auto * const file{ fopen (path.c_str (), " rb" ) };
12
12
if (!file) {
13
- const auto message{ " File not found:" + path };
13
+ const auto message{ " File not found: " + path };
14
14
throw std::exception{message.c_str ()};
15
15
}
16
16
@@ -118,19 +118,19 @@ int main(int argc, char** argv) {
118
118
else if (argc == 2 ) {
119
119
path = argv[1 ];
120
120
}
121
- else {
122
- std::cerr << " Unsupported launch: try bmp2spessart <file>" << std::endl;
123
- return 1 ;
124
- }
125
121
122
+ if (path.empty ()) {
123
+ std::cerr << " Unsupported launch: try bmp2spessart <file>" << std::endl;
124
+ } else
126
125
try {
127
126
convert (path);
128
127
}
129
128
catch (const std::exception& e) {
130
- std::cerr << e.what ();
131
- return 1 ;
129
+ std::cerr << e.what () << std::endl;
132
130
}
133
-
131
+
132
+ std::cout << " Done, press any key to exit" ;
133
+ system (" pause" );
134
134
return 0 ;
135
135
136
136
}
You can’t perform that action at this time.
0 commit comments