stpncpy replaced with memcpy

To make compiling under windows easier, references to stpncpy have been
removed and replaced with memcpy.