strncpy() causes reset

There is no way to do this with C casts unless you know that the original variable is const in every case to start with, and explicitly cast as (const char *).

If you don't know what the original type is, casting is hardly a good idea. The reason for most casts is to allow a function to accept a const array, when you KNOW that the function is not going to change the contents of the array, but the function doesn't explicitly guarantee that by using the const keyword.

In the case that OP is talking about, I can't figure out why ether.tcpReply() returns a const pointer. Why does it care if you want to point it to something else, or alter the contents that it points to?