char AT[2] = "AT";
char AT_COMPLEMENT[4] = "\r\n";
How can I join the two strings in ESP-IDF?
Actually ESP-IDF uses C, so I fix it with this:
char *AT = "AT"; const char *AT_COMPLEMENT= "\r\n";
char * strcat (char * dest, const char * src)
AT is a pointer to a string array of 3-byte long (including terminating \0), if you strcat(char* dest, const char* src) means strcat(AT, AT_COMPLEMNT), you will have an overflow on AT array, if may not crash immediately, but it will sooner or later.