detangle casts a little
document deliberate use of strncpy behaviour for coverity
cid#84030 Copy into fixed size buffer
cid#84029 Copy into fixed size buffer