diff options
author | randomdan <randomdan@localhost> | 2011-06-29 19:13:24 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-06-29 19:13:24 +0000 |
commit | a58275c27dcd17f02c8873786b93b553c18ad0bb (patch) | |
tree | 6f2d08957cf0f2a7e08d55f14f319d0dc1b980cc /project2/fileStrmVarWriter.cpp | |
parent | Build fsRows against both versions 2 and 3 of boost::filesystem (diff) | |
download | project2-a58275c27dcd17f02c8873786b93b553c18ad0bb.tar.bz2 project2-a58275c27dcd17f02c8873786b93b553c18ad0bb.tar.xz project2-a58275c27dcd17f02c8873786b93b553c18ad0bb.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.cpp | 8 |
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()); |