From e75f44100e25501614f71080929a6ab45f871f68 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 13 Jan 2016 20:58:58 -0500 Subject: [PATCH] dbAccess: dbGet wrap at capacity count not valid count Change the usage of rset::get_array_info in dbGet() in the case that offset>0 and no_elementstype == dbfl_type_rec) { field_type = paddr->field_type; - no_elements = paddr->no_elements; + max_elements = no_elements = paddr->no_elements; } else { field_type = pfl->field_type; - no_elements = pfl->no_elements; + max_elements = no_elements = pfl->no_elements; } if (field_type >= DBF_INLINK && field_type <= DBF_FWDLINK) @@ -906,7 +906,7 @@ long dbGet(DBADDR *paddr, short dbrType, if (n <= 0) { ;/*do nothing*/ } else if (!pfl || pfl->type == dbfl_type_rec) { - status = convert(paddr, pbuf, n, no_elements, offset); + status = convert(paddr, pbuf, n, max_elements, offset); } else { DBADDR localAddr = *paddr; /* Structure copy */ @@ -917,7 +917,7 @@ long dbGet(DBADDR *paddr, short dbrType, localAddr.pfield = (char *) &pfl->u.v.field; else localAddr.pfield = (char *) pfl->u.r.field; - status = convert(&localAddr, pbuf, n, no_elements, offset); + status = convert(&localAddr, pbuf, n, max_elements, offset); } } done: