hi,
'im having trouble with this code
this code reads dongle information
retcode = SDX_Read(handle, 2, buffer);
if (retcode < 0)
{
ads_printf(_T("Error READING dongle: %08x\n"), retcode);
acedRetNil();
}
for(int i = 0; i < 512; i++)
{
block2[i] = (TCHAR) buffer[i];
}
block2[8]=_T('\0');
TCHAR Dd[2];
TCHAR Dm[2];
TCHAR Dj[2];
_tcsncpy(Dj,block2+0,2);
// Dj[2]=_T('\0');
_tcsncpy(Dm,block2+3,2);
// Dm[2]=_T('\0');
_tcsncpy(Dd,block2+6,2);
// Dd[2]=_T('\0');
acad 2015 crashed on the commented lines, works fine in any other acads
block2 contains "12.07.20" a date which is correct.
what am i'm missing or doing wrong ?
ty !
The commented lines are each writing past the end of a 2-element array, a classical buffer overrun error.