diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-08 09:30:54 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-08 09:30:54 +0100 |
commit | 552b997007a24943429488a3cc46c3e649316947 (patch) | |
tree | 39bf2835817314c9d09988e8704aa55285cd79c7 /apps/sample-convert.cpp | |
parent | 7088a4a5639b27a4c82eb6f6560ec1f1fd538fd4 (diff) | |
download | ble-toys-552b997007a24943429488a3cc46c3e649316947.tar.gz ble-toys-552b997007a24943429488a3cc46c3e649316947.tar.bz2 ble-toys-552b997007a24943429488a3cc46c3e649316947.tar.xz ble-toys-552b997007a24943429488a3cc46c3e649316947.zip |
o Improved SQL output.
Diffstat (limited to 'apps/sample-convert.cpp')
-rw-r--r-- | apps/sample-convert.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp index 370059c..23a04ff 100644 --- a/apps/sample-convert.cpp +++ b/apps/sample-convert.cpp @@ -37,6 +37,10 @@ public: inputStream = &cin; } else { inputStream = new ifstream(inputFile); + if (inputStream->fail()) { + cerr << "Unable to open input file " << inputFile << endl; + return EXIT_FAILURE; + } } ostream *outputStream; @@ -44,6 +48,10 @@ public: outputStream = &cout; } else { outputStream = new ofstream(outputFile); + if (outputStream->fail()) { + cerr << "Unable to open output file " << outputFile << endl; + return EXIT_FAILURE; + } } if (outputFormat == "plain") { |