I have unsigned int variable that throughout code is either assigned a 0 or a 1 ....that's it....I am noticing the debugger when stopped sometimes (due to code going awry ---- verified with logic analyzer) that the variable is showing large int values like 15191, etc....I am now wondering if I am running into buffer overflow issues. I am using memcpy multiple times throughout the code and I found that ppl are saying buffer overflow can be a very real issue with memcpy. Can someone tell me if the following should be ok to use without buffer overflow issues?
Code:
memcpy(radioID, (const void *)&RXData[9], sizeof(radioID));
Here radioID is 4 deep
RXData is 32 deep BUT I am specifically using the sizeof on the smaller array
Thanks