This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2355: strcat not working??

Part Number: MSP430FR2355


Can someone tell me what I am doing wrong in this small block:

        mssg = Send;
        strcpy(Send, "HelloWorld");
        m = strlen(mssg);
        CRC_Result = CRC(mssg, m);
        CRC_char[0] = (CRC_Result >> 8) & 0xFF;
        CRC_char[1] = (CRC_Result & 0xFF);
        mssg = (strcat(mssg, (const char*)CRC_char));

    char *mssg, junk, CRC_char[2];
    uint CRC_Result, m;
    char Send[BUFFER_SIZE] = {[0 ... BUFFER_SIZE-1] = 0xFF};

BUFFER_SIZE = 30.

The CRC_Result has been verified and is good.  It is an unsigned int. However when I do the concatentation I get the CRC added to the message AND then after that I get the byte swapped CRC added to the message.  I have tried all kinds of variants and can't seem to find what I am doing wrong?  If I concat a string constant like "Today" to my mssg it works fine.  CRC_char looks as expected after CRC_Result.

Thanks

**Attention** This is a public forum