diff options
-rw-r--r-- | pgsql.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 { |