X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fchap.c;h=6b405f195d409d62734294544ed9707256c1080a;hp=96348e1c1eb4967a2483db40701862192206d6c5;hb=1fae28ce79350b03f0cf8a69ad06dd68637cd6b1;hpb=0875ace97fd7efe9a109a282a2f30c20872c78aa diff --git a/pppd/chap.c b/pppd/chap.c index 96348e1..6b405f1 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -34,7 +34,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap.c,v 1.17 1999/02/26 10:38:51 paulus Exp $"; +static char rcsid[] = "$Id: chap.c,v 1.18 1999/03/12 06:07:15 paulus Exp $"; #endif /* @@ -442,8 +442,7 @@ ChapReceiveChallenge(cstate, inp, id, len) /* Microsoft doesn't send their name back in the PPP packet */ if (remote_name[0] != 0 && (explicit_remote || rhostname[0] == 0)) { - strncpy(rhostname, remote_name, sizeof(rhostname)); - rhostname[sizeof(rhostname) - 1] = 0; + strlcpy(rhostname, sizeof(rhostname), remote_name); CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: using '%s' as remote name", rhostname)); }