$OpenBSD: patch-Core_PostgreSQLLargeObject_cpp,v 1.2 2017/08/19 12:47:38 jasper Exp $

https://bitbucket.org/sjodogne/orthanc-postgresql/commits/5ced32a226b1946fdb9cf832373107ae0ae7aa27

Index: Core/PostgreSQLLargeObject.cpp
--- Core/PostgreSQLLargeObject.cpp.orig
+++ Core/PostgreSQLLargeObject.cpp
@@ -150,14 +150,14 @@ namespace OrthancPlugins
       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;
       }
     }
   };
