All im trying to do is add a string to strcpy and concatenate with a short. But i am getting two error doing this the code is below
struct local_stack_def
{
char *result;
char delims[3];
char user_id_E[200];
short user_maxlen, range_eulm, imp_eulm, len_eulm;
char msg_eulm[400];
/*MORE VARIABLE REMOVED TO SHORTEN LENGTH*/
};
short pool_err;
struct local_stack_def *l;
l = POOL_GETSPACE_(i_exit_cb->Pool_addr,sizeof(struct local_stack_def),&pool_err );
/*MORE VARIABLE REMOVED TO SHORTEN LENGTH*/
if (l->resultFR != 0)
{
l->range_eulm= 1501;
strcpy(l->msg_eulm,"FILENAME_RESOLVE_ ERROR - ERROR#:");
strcat(l->msg_eulm, l->resultFR);
With the strcpy and strcat i get these errors
strcpy(l->msg_eulm,"FILENAME_RESOLVE_ ERROR - ERROR#:");
Warning 207: address pointing at code space is taken
strcat(l->msg_eulm, l->resultFR);
Warning 86: argument 2 conflicts with formal definition
Both functions work on
char*types.When you use
strcpyon some constant string you defined, this string is located in code space which could be a problem, hence the warning.The second error is caused because you cannot concat an integer to a string.
When you want to print the value of this short you need to convert it for example via sprintf into an
char*and than concat thischar*.