There is this function (as part of 30 pages code, which cant be added here, but i hope my mistake is right in the next code that you can quickly see )
void handleIncomingData( char *incoming)
{
// incoming is never null
char copyIncoming[85]={0};
strcpy(copyIncoming,incoming); //
parseGetRespondHeader(copyIncoming);
char *header = strtok (copyIncoming,":");
char *dataA=strtok (NULL, ":");
char *dataB=strtok (NULL, ":");
if(strstr(header, PROTOCOL_GET_WIFI_UNIQUEID ) != NULL)
{
char myid[25];
sprintf(myid,"myid:%s",UNIQUE_ID);
strcpy(incoming,myid);
sendServer(incoming); // *** here incoming gets a value called "myID:xxxx"
}
What happens is that when this "if" statement happens, and then later i call this function AGAIN , the "incoming" value is holds the previous value (i showed here- myID:xxxx) , and not the new one i insert into it in the new call.
When this "if" is not met in the first call, then the second call to the function holds the right new value .
What is wrong with this "if" in the first call, that causing the "incoming" string, to continue and hold the last value even that i insert a new one to it in the next call??
thanks very much .