From the strncpy(3) manpage: The strings may not overlap, and the destination string dest must be large enough to receive the copy. http://bugs.gentoo.org/104311 --- ftp/ftp.c +++ ftp/ftp.c @@ -1808,7 +1808,7 @@ } ip->connect = connected; connected = op->connect; - if (hostname) { + if (hostname && ip->name != hostname) { (void) strncpy(ip->name, hostname, sizeof(ip->name) - 1); ip->name[sizeof(ip->name) - 1] = '\0'; }