append array of byte to other which contains '0'
-
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;
!= 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.
-
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;
!= 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.
Please do not post the same thing in multiple places - it wastes time and annoys people. You already have this is QA - so pick one and stick to it!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...