2024-02-15 04:34 AM - last edited on 2024-02-15 08:27 AM by SofLit
Hi, I am having problem with string copy strncpy(). I am getting error message "Cannot access memory at address 0x31203a6e"
static char *DataBuffer[30] = {0};
for(char *str =strtok((char*)recdata, "\n\n"); str; str = strtok(NULL, "\n\n"))
{
strncpy(DataBuffer, str, strlen(str)+2);
strcat(DataBuffer,"\n");
strncpy(DataBuffer, str, strlen(str)+2);
}
Is it memory addressing access faults. Is the chip failing memory handling. How do I debug it to find out.
2024-02-25 06:21 AM
NULL is not a pointer to a string pointer. Use &recdata, assuming recdata is a string pointer.