Fixed Bug #3080

Replaced strncpy with safestrncpy where I found would be beneficial.
http://hercules.ws/board/tracker/issue-3080-safestrncpy-instead-of-strncpy-where-applicable/
Also modifying headers accordingly.

Signed-off-by: shennetsind <ind@henn.et>