Fixed incorrect use of strncpy instead of memcpy