Issue regarding memcpy in JDE 9.1

avishek

Active Member
Hi all,

We are upgrading from Xe to JDE 9.1. We are not a team of C developers but we need to make a modification to a customised C program which was imported from Xe to 9.1. Could you read the following snippet and offer any clues as to what's wrong?

if (iParamPos <= (int) 30)
{
switch (iParameter)
{
case 0:
memcpy(lpDS->szParameter1 + iParamPos,(JCHAR *) &lpDS->szSourceString[iPos],(int) 1);
break;
case 1:
memcpy(lpDS->szParameter2 + iParamPos,(JCHAR *) &lpDS->szSourceString[iPos],(int) 1);
break;


-------------------------
Thanks in advance
Developer
JD Edwards EnterpriseOne 9.1
Oracle 11g
 
Hello

I believe that this will work.

memcpy(lpDS->szParameter1 + iParamPos,(JCHAR *) &lpDS->szSourceString[iPos],sizeof(JCHAR));

But it seems that you just want to copy one letter from szSourceString to szParameter1 at the iParamPos. You can copy one letter thru = operator.

*(lpDS->szParametr1 + iParamPos) = lpDS->szSourceString[iPos] ;
 
Back
Top