strncpy() causes reset

How do I do that?

Wouldn't that depend on where the "problem" is occurring? You haven't said.