summaryrefslogtreecommitdiff
path: root/project2/fileStrmVarWriter.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-06-29 19:13:24 +0000
committerrandomdan <randomdan@localhost>2011-06-29 19:13:24 +0000
commitb20f8191ea4da22bc7191e10e46c2875d8718269 (patch)
tree6f2d08957cf0f2a7e08d55f14f319d0dc1b980cc /project2/fileStrmVarWriter.cpp
parentBuild fsRows against both versions 2 and 3 of boost::filesystem (diff)
downloadproject2-b20f8191ea4da22bc7191e10e46c2875d8718269.tar.bz2
project2-b20f8191ea4da22bc7191e10e46c2875d8718269.tar.xz
project2-b20f8191ea4da22bc7191e10e46c2875d8718269.zip
Fix unused_result warning when compiled with optimization enabled
Fix incorrect error handling when object loading fails
Diffstat (limited to 'project2/fileStrmVarWriter.cpp')
-rw-r--r--project2/fileStrmVarWriter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/project2/fileStrmVarWriter.cpp b/project2/fileStrmVarWriter.cpp
index 8f3ca5c..564c86a 100644
--- a/project2/fileStrmVarWriter.cpp
+++ b/project2/fileStrmVarWriter.cpp
@@ -49,10 +49,14 @@ void FileStreamVariableWriter::operator()(const double & i) const {
fprintf(out, "%g", i);
}
void FileStreamVariableWriter::operator()(const Glib::ustring & i) const {
- fwrite(i.c_str(), i.bytes(), 1, out);
+ if (fwrite(i.c_str(), i.bytes(), 1, out) < 1) {
+ // Care much? None of the others check.
+ }
}
void FileStreamVariableWriter::operator()(const boost::shared_ptr<const Glib::ustring> & i) const {
- fwrite(i->c_str(), i->bytes(), 1, out);
+ if (fwrite(i->c_str(), i->bytes(), 1, out) < 1) {
+ // Care much? None of the others check.
+ }
}
void FileStreamVariableWriter::operator()(const boost::posix_time::ptime & i) const {
fprintf(out, "[%s]", boost::posix_time::to_iso_extended_string(i).c_str());