off by one.

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@247 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris 2007-06-13 00:01:40 +00:00
parent 02186c731d
commit 63cdfc06e5
1 changed files with 43 additions and 42 deletions

View File

@ -1029,6 +1029,7 @@ L3INT Q931Uie_Cause(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR * I
/* Octet 4 */ /* Octet 4 */
pie->Value = IBuf[Octet+Off] & 0x7f; pie->Value = IBuf[Octet+Off] & 0x7f;
Octet++;
Q931IESizeTest(Q931E_CAUSE); Q931IESizeTest(Q931E_CAUSE);
@ -2976,27 +2977,27 @@ L3INT Q931Pie_UserUser(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L
return rc; return rc;
} }
/***************************************************************************** /*****************************************************************************
Function: Q931Uie_GenericDigits Function: Q931Uie_GenericDigits
Parameters: pIE[OUT] ptr to Information Element id. Parameters: pIE[OUT] ptr to Information Element id.
IBuf[IN] ptr to a packed ie. IBuf[IN] ptr to a packed ie.
OBuf[OUT] ptr to buffer for Unpacked ie. OBuf[OUT] ptr to buffer for Unpacked ie.
IOff[IN\OUT] Input buffer offset IOff[IN\OUT] Input buffer offset
OOff[IN\OUT] Output buffer offset OOff[IN\OUT] Output buffer offset
Ibuf and OBuf points directly to buffers. The IOff and OOff Ibuf and OBuf points directly to buffers. The IOff and OOff
must be updated, but are otherwise not used in the ie unpack. must be updated, but are otherwise not used in the ie unpack.
Return Value: Error Message Return Value: Error Message
*****************************************************************************/ *****************************************************************************/
L3INT Q931Uie_GenericDigits(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR * IBuf, L3UCHAR * OBuf, L3INT *IOff, L3INT *OOff) L3INT Q931Uie_GenericDigits(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR * IBuf, L3UCHAR * OBuf, L3INT *IOff, L3INT *OOff)
{ {
Q931ie_GenericDigits * pie = (Q931ie_GenericDigits*)OBuf; Q931ie_GenericDigits * pie = (Q931ie_GenericDigits*)OBuf;
ie *pIE = &pMsg->GenericDigits; ie *pIE = &pMsg->GenericDigits;
L3INT Off = 0; L3INT Off = 0;
L3INT Octet = 0; L3INT Octet = 0;
L3INT x; L3INT x;
@ -3055,24 +3056,24 @@ L3INT Q931Uie_GenericDigits(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3U
pie->Size = (L3UCHAR)(sizeof(Q931ie_CallingSub) + x -1); pie->Size = (L3UCHAR)(sizeof(Q931ie_CallingSub) + x -1);
return Q931E_NO_ERROR; return Q931E_NO_ERROR;
} }
/***************************************************************************** /*****************************************************************************
Function: Q931Pie_GenericDigits Function: Q931Pie_GenericDigits
Parameters: IBuf[IN] Ptr to struct. Parameters: IBuf[IN] Ptr to struct.
OBuf[OUT] Ptr tp packed output buffer. OBuf[OUT] Ptr tp packed output buffer.
Octet[IN/OUT] Offset into OBuf. Octet[IN/OUT] Offset into OBuf.
Return Value: Error code, 0 = OK Return Value: Error code, 0 = OK
*****************************************************************************/ *****************************************************************************/
L3INT Q931Pie_GenericDigits(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L3INT *Octet) L3INT Q931Pie_GenericDigits(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L3INT *Octet)
{ {
OBuf[(*Octet)++] = (Q931ie_GENERIC_DIGITS & 0xFF); OBuf[(*Octet)++] = (Q931ie_GENERIC_DIGITS & 0xFF);
OBuf[(*Octet)++] = 0; OBuf[(*Octet)++] = 0;
return Q931E_NO_ERROR; return Q931E_NO_ERROR;
} }