diff options
Diffstat (limited to 'libqpdf/Pl_StdioFile.cc')
-rw-r--r-- | libqpdf/Pl_StdioFile.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libqpdf/Pl_StdioFile.cc b/libqpdf/Pl_StdioFile.cc index e4b96a9e..4f30ae22 100644 --- a/libqpdf/Pl_StdioFile.cc +++ b/libqpdf/Pl_StdioFile.cc @@ -1,10 +1,10 @@ -#include <qpdf/qpdf-config.h> // include first for large file support +#include <qpdf/qpdf-config.h> // include first for large file support #include <qpdf/Pl_StdioFile.hh> #include <qpdf/QUtil.hh> -#include <stdexcept> #include <errno.h> +#include <stdexcept> Pl_StdioFile::Members::Members(FILE* f) : file(f) @@ -29,16 +29,12 @@ void Pl_StdioFile::write(unsigned char* buf, size_t len) { size_t so_far = 0; - while (len > 0) - { + while (len > 0) { so_far = fwrite(buf, 1, len, this->m->file); - if (so_far == 0) - { + if (so_far == 0) { QUtil::throw_system_error( this->identifier + ": Pl_StdioFile::write"); - } - else - { + } else { buf += so_far; len -= so_far; } @@ -48,11 +44,8 @@ Pl_StdioFile::write(unsigned char* buf, size_t len) void Pl_StdioFile::finish() { - if ((fflush(this->m->file) == -1) && - (errno == EBADF)) - { + if ((fflush(this->m->file) == -1) && (errno == EBADF)) { throw std::logic_error( - this->identifier + - ": Pl_StdioFile::finish: stream already closed"); + this->identifier + ": Pl_StdioFile::finish: stream already closed"); } } |