The bug occurs because the destination array is too small for the 4 characters and the required NULL character at the end. The character array containing "ABCD" needs to be at least 5 bytes big.
So the answer is to use strncpy. I cannot increase the size of the buffer by 1 byte because it is part of a larger data structure. The only viable workaround is to use strncpy or possibly ClassEMemory::MemCpy instead of ClassEStd::StrCpy. I raised this as a possible bug to the different behaviour between StrCpy and strncpy which I thought would behave the same.
Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum