X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=87a902fc0bb87524b878f14656afbb886aba4be0;hb=f52db44405c7cc9620701eda20889dc6743f8437;hp=b54f95a98cad3d3d89b287ca0c29be96a1148df0;hpb=6f9174716453eb7f8571eccc48c1683947da2514;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index b54f95a..87a902f 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.21 1995/06/12 12:02:20 paulus Exp $"; +static char rcsid[] = "$Id: options.c,v 1.23 1995/07/04 12:33:01 paulus Exp $"; #endif #include @@ -1132,7 +1132,12 @@ static int setdomain(argv) char **argv; { - strncat(hostname, *argv, MAXNAMELEN - strlen(hostname)); + gethostname(hostname, MAXNAMELEN); + if (**argv != 0) { + if (**argv != '.') + strncat(hostname, ".", MAXNAMELEN - strlen(hostname)); + strncat(hostname, *argv, MAXNAMELEN - strlen(hostname)); + } hostname[MAXNAMELEN-1] = 0; return (1); }