diff options
author | Jay Berkenbilt <ejb@ql.org> | 2020-10-22 21:18:13 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2020-10-22 21:39:36 +0200 |
commit | 30bb4c64eeddef030132e467c6388d5695a4117c (patch) | |
tree | edbcaafd2d38babe0fedd933410cd7955dbc7225 /qpdf | |
parent | 232f5fc9f3bed8e1b02bca5d10b2eca444e30f95 (diff) | |
download | qpdf-30bb4c64eeddef030132e467c6388d5695a4117c.tar.zst |
Minor code cleanup
* Return rather than exiting from realmain in qpdf.cc
* Remove extraneous blank line
* Don't assign temporary to const reference
Diffstat (limited to 'qpdf')
-rw-r--r-- | qpdf/qpdf.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index 4bb00561..86cd6ad7 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -5730,7 +5730,7 @@ int realmain(int argc, char* argv[]) { // Allow --is-encrypted and --requires-password to // work when an incorrect password is supplied. - exit(0); + return 0; } throw e; } @@ -5739,22 +5739,22 @@ int realmain(int argc, char* argv[]) { if (pdf.isEncrypted()) { - exit(0); + return 0; } else { - exit(EXIT_IS_NOT_ENCRYPTED); + return EXIT_IS_NOT_ENCRYPTED; } } else if (o.check_requires_password) { if (pdf.isEncrypted()) { - exit(EXIT_CORRECT_PASSWORD); + return EXIT_CORRECT_PASSWORD; } else { - exit(EXIT_IS_NOT_ENCRYPTED); + return EXIT_IS_NOT_ENCRYPTED; } } if (! o.page_specs.empty()) @@ -5788,14 +5788,14 @@ int realmain(int argc, char* argv[]) << " resulting file may have some problems" << std::endl; } - // Still exit with warning code even if warnings were suppressed. - exit(EXIT_WARNING); + // Still return with warning code even if warnings were suppressed. + return EXIT_WARNING; } } catch (std::exception& e) { std::cerr << e.what() << std::endl; - exit(EXIT_ERROR); + return EXIT_ERROR; } return 0; |