[gnote] Make file_read_all_* throw on failed read
- From: Aurimas ÄŒernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Make file_read_all_* throw on failed read
- Date: Thu, 16 Feb 2017 11:11:44 +0000 (UTC)
commit 999bd94ac18f4f0946b45a35359601a6015b6224
Author: Aurimas ÄŒernius <aurisc4 gmail com>
Date: Thu Feb 16 12:32:40 2017 +0200
Make file_read_all_* throw on failed read
src/sharp/files.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/sharp/files.cpp b/src/sharp/files.cpp
index d2fae2a..ec3500c 100644
--- a/src/sharp/files.cpp
+++ b/src/sharp/files.cpp
@@ -89,6 +89,9 @@ namespace sharp {
while(std::getline(fin, line)) {
lines.push_back(line);
}
+ if(!fin.eof()) {
+ throw sharp::Exception("Failure reading file");
+ }
fin.close();
}
else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]