]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/options.c
Use SIGNAL not signal because the former doesn't reset the handler
[ppp.git] / pppd / options.c
index b54f95a98cad3d3d89b287ca0c29be96a1148df0..87a902fc0bb87524b878f14656afbb886aba4be0 100644 (file)
@@ -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 <stdio.h>
@@ -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);
 }