summaryrefslogtreecommitdiff
path: root/pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'pgsql.c')
-rw-r--r--pgsql.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pgsql.c b/pgsql.c
index f424b35..684409b 100644
--- a/pgsql.c
+++ b/pgsql.c
@@ -318,6 +318,10 @@ int psql_read_buf( PGconn *conn, const int id, const char *path, char *buf, cons
return tmp;
}
+ if( meta.size == 0 ) {
+ return 0;
+ }
+
size = len;
if( offset + size > meta.size ) {
size = meta.size - offset;