Skip to content

Commit e294d7b

Browse files
committed
Fixing some error handling.
1 parent e43e686 commit e294d7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main_common.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Calibrator* Calibrator::make_calibrator(int argc, char** argv)
290290

291291
// unknown option
292292
else {
293-
fprintf(stderr, "Unknown option: %s\n\n", argv[i]);
293+
error ( "Unknown option: %s\n\n", argv[i]);
294294
usage(argv[0], thr_misclick);
295295
exit(0);
296296
}
@@ -316,15 +316,15 @@ Calibrator* Calibrator::make_calibrator(int argc, char** argv)
316316
if (list_devices) {
317317
// printed the list in find_device
318318
if (nr_found == 0)
319-
printf("No calibratable devices found.\n");
320-
exit(2);
319+
error ("No calibratable devices found.\n");
320+
exit(0);
321321
}
322322

323323
if (nr_found == 0) {
324324
if (pre_device == NULL)
325-
fprintf (stderr, "Error: No calibratable devices found.\n");
325+
error ( "Error: No calibratable devices found.\n");
326326
else
327-
fprintf (stderr, "Error: Device \"%s\" not found; use --list to list the calibratable input devices.\n", pre_device);
327+
error ( "Error: Device \"%s\" not found; use --list to list the calibratable input devices.\n", pre_device);
328328
exit(1);
329329

330330
} else if (nr_found > 1) {

0 commit comments

Comments
 (0)