Use single strncpy for &quot; and fix compilier warning aboutr *ptr++