Without you posting some code, there is no hope.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
> p = calc(sip); // checksum calc
So does calc return a pointer to some super-secret memory location?
If it's just a regular char array, then it as gone out of scope, and p is pointing at invalid memory.
> sprintf( sip, %s%s%s,sip, p, "\r" );
sip is BOTH source and destination in this sprintf call.
This is very bad code. There are very few C library functions which are safe when presented with overlapping memory.
Why are you basically writing C in C++ ?
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953