eydeak
VIP Member
Is there a limitation on the size of a string in the memcpy function? The BSFN I'm calling has the following variables defined:
typedef struct tagDSD5534A10B
{
JCHAR szFlatFileName[121];
ID idFilePtr;
JCHAR szFlatFileRecord[1501];
MATH_NUMERIC mnRecordLength;
JCHAR cSuppressErrorMessage;
JCHAR cErrorCode;
JCHAR szErrorMessageID[11];
} DSD5534A10B, *LPDSD5534A10B;
int nRecordLength=0;
JCHAR szRecord[1501];
Inside the BSFN there is the following call to memcpy:
memcpy(lpDS->szFlatFileRecord, szRecord, nRecordLength)
When I walk through in debug, the full string is contained in szRecord and nRecordLength is 400. However, after the call to memcpy the resulting szFlagFileRecord has a copy of szRecord truncated at 200 characters.
I didn't write the BSFN with this code, but I'm trying to call it from a UBE. I'm confused that the results are being truncated. It looks like everything is defined big enough, so I'm wondering if there is a limitation on memcpy itself.
Thanks,
typedef struct tagDSD5534A10B
{
JCHAR szFlatFileName[121];
ID idFilePtr;
JCHAR szFlatFileRecord[1501];
MATH_NUMERIC mnRecordLength;
JCHAR cSuppressErrorMessage;
JCHAR cErrorCode;
JCHAR szErrorMessageID[11];
} DSD5534A10B, *LPDSD5534A10B;
int nRecordLength=0;
JCHAR szRecord[1501];
Inside the BSFN there is the following call to memcpy:
memcpy(lpDS->szFlatFileRecord, szRecord, nRecordLength)
When I walk through in debug, the full string is contained in szRecord and nRecordLength is 400. However, after the call to memcpy the resulting szFlagFileRecord has a copy of szRecord truncated at 200 characters.
I didn't write the BSFN with this code, but I'm trying to call it from a UBE. I'm confused that the results are being truncated. It looks like everything is defined big enough, so I'm wondering if there is a limitation on memcpy itself.
Thanks,