I have this function which append an array of byte to an other array of bytes
but the problem appears when the source contains '\0'
this what I have :
private void Aes_Strcat(sbyte[] a_pchResult, sbyte[] pchResult, int m_iBlockSize)
{
int x = 0;
while (a_pchResult[x] != 0)
{
x++;
}
Buffer.BlockCopy(pchResult, 0, a_pchResult, x, m_iBlockSize);
}
here when the a_pchResult contains for example { -10, 15,3,45,17,25,0,56,41,12,0,0,0,0,0,0}
and I want to add pchResult to it at the end (it means after the '12' element)
but as you say it will add it after '25' because it find the '0' before the end.
any idea how know the last position to add the new array at the end of source array if it contains '\0' element.