# HG changeset patch
# User Jasper Lievisse Adriaanse <jasper@humppa.nl>
# Date 1502296370 -7200
#      Wed Aug 09 18:32:50 2017 +0200
# Branch lo_read_type
# Node ID 0c8e955833d7a6f97381a7bcfe935ab490d05fe5
# Parent  cdc12000160c77940617eb9a6ea26c2891fbb618
lo_read() returns an int

diff -r cdc12000160c -r 0c8e955833d7 Core/PostgreSQLLargeObject.cpp
--- a/Core/PostgreSQLLargeObject.cpp	Fri Jan 06 11:03:20 2017 +0100
+++ b/Core/PostgreSQLLargeObject.cpp	Wed Aug 09 18:32:50 2017 +0200
@@ -151,14 +151,14 @@
       for (size_t position = 0; position < size_; )
       {
         size_t remaining = size_ - position;
-        size_t nbytes = lo_read(pg_, fd_, target + position, remaining);
+        int nbytes = lo_read(pg_, fd_, target + position, remaining);
 
         if (nbytes < 0)
         {
           throw PostgreSQLException("Unable to read the large object in the database");
         }
 
-        position += nbytes;
+        position += (size_t)nbytes;
       }
     }
   };
