From 39534c75341d68f8f571d3045cbadd37669317d1 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 14 Oct 2006 01:00:40 +0000 Subject: Don't strncpy a string to itself git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18701 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftp/ftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/appl') diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c index 6ef4e88..93ace90 100644 --- a/src/appl/gssftp/ftp/ftp.c +++ b/src/appl/gssftp/ftp/ftp.c @@ -1684,7 +1684,8 @@ void pswitch(int flag) ip->connect = connected; connected = op->connect; if (hostname) { - (void) strncpy(ip->name, hostname, sizeof(ip->name) - 1); + if (ip->name != hostname) + (void) strncpy(ip->name, hostname, sizeof(ip->name) - 1); ip->name[strlen(ip->name)] = '\0'; } else ip->name[0] = 0; -- cgit v1.1