diff options
-rw-r--r-- | libdbpp/connection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdbpp/connection.cpp b/libdbpp/connection.cpp index 531b5bb..7d3db42 100644 --- a/libdbpp/connection.cpp +++ b/libdbpp/connection.cpp @@ -154,8 +154,8 @@ DB::Connection::bulkUploadData(FILE * in) const bulkUploadData(buf.data(), r); total += r; } - if (-r > 0) { - throw std::system_error(static_cast<int>(-r), std::system_category()); + if (const auto err = ferror(in)) { + throw std::system_error(err, std::system_category()); } return total; } |