From 9774b2ce292878fc59ba432ba324e58c54eca1d9 Mon Sep 17 00:00:00 2001 From: dimitr Date: Sun, 18 Apr 2010 00:36:30 +0000 Subject: [PATCH] Correction. --- src/utilities/gstat/dba.epp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/utilities/gstat/dba.epp b/src/utilities/gstat/dba.epp index 81d89c9066..c0544e9ff9 100644 --- a/src/utilities/gstat/dba.epp +++ b/src/utilities/gstat/dba.epp @@ -1559,14 +1559,9 @@ static USHORT get_format_length(ISC_STATUS* status_vector, isc_db_handle databas buffer.resize(return_length); - USHORT count = buffer[0] | (buffer[1] << 8); - USHORT format_length = 0; - for (const Ods::Descriptor* desc = (Ods::Descriptor*) &buffer[2]; count--; desc++) - { - format_length += desc->dsc_length; - } - - return format_length; + const USHORT count = buffer[0] | (buffer[1] << 8); + const Ods::Descriptor* const desc = (Ods::Descriptor*) &buffer[2] + count - 1; + return desc->dsc_offset + desc->dsc_length; }