From 71af4127cee03bf9ad2b674f7926b25d7f1ca30f Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 1 Nov 2012 08:08:54 -0700 Subject: [PATCH] Add error checking to respack --- aegisub/tools/common-respack.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aegisub/tools/common-respack.cpp b/aegisub/tools/common-respack.cpp index 99f644377..6df9866ca 100644 --- a/aegisub/tools/common-respack.cpp +++ b/aegisub/tools/common-respack.cpp @@ -67,6 +67,21 @@ int main(int argc, const char *argv[]) { std::ofstream file_cpp(argv[2]); std::ofstream file_h(argv[3]); + if (!file_manifest.good()) { + std::cout << "Failed to open manifest" << std::endl; + return 1; + } + + if (!file_cpp.good()) { + std::cout << "Failed to open output CPP file" << std::endl; + return 1; + } + + if (!file_h.good()) { + std::cout << "Failed to open output H file" << std::endl; + return 1; + } + // If the manifest has a path use that as the base for finding files. std::string manifest(argv[1]); std::string path_base;