From a9f4cb486a76f9369386b3750c8571304f4503c6 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 20 Apr 2012 15:02:24 +0200 Subject: - --- pgsql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pgsql.c') diff --git a/pgsql.c b/pgsql.c index ba51f95..1527281 100644 --- a/pgsql.c +++ b/pgsql.c @@ -483,7 +483,7 @@ update_again: } else if( offset == 0 && len < STANDARD_BLOCK_SIZE ) { sprintf( sql, "UPDATE data set data = $3::bytea || substring( data from %u for %u ) WHERE dir_id=$1::int4 AND block_no=$2::int4", - len + 1, STANDARD_BLOCK_SIZE - (unsigned int)len ); + (unsigned int)len + 1, STANDARD_BLOCK_SIZE - (unsigned int)len ); /* keep data on the left */ } else if( offset > 0 && offset + len == STANDARD_BLOCK_SIZE ) { @@ -496,7 +496,7 @@ update_again: sprintf( sql, "UPDATE data set data = substring( data from %d for %d ) || $3::bytea || substring( data from %u for %u ) WHERE dir_id=$1::int4 AND block_no=$2::int4", 1, (unsigned int)offset, - (unsigned int)offset + len + 1, STANDARD_BLOCK_SIZE - ( (unsigned int)offset + (unsigned int)len ) ); + (unsigned int)offset + (unsigned int)len + 1, STANDARD_BLOCK_SIZE - ( (unsigned int)offset + (unsigned int)len ) ); /* we should never get here */ } else { -- cgit v1.2.3-54-g00ecf