]> andersk Git - moira.git/blobdiff - update/hostname.c
Initial revision
[moira.git] / update / hostname.c
index 09a9129dad0a18d248c3fc17f03c88e25a03f65f..1cb89e37fa04a8d5a9378539727a632102a3297a 100644 (file)
@@ -2,18 +2,22 @@
  *     $Source$
  *     $Header$
  */
+/*  (c) Copyright 1988 by the Massachusetts Institute of Technology. */
+/*  For copying and distribution information, please see the file */
+/*  <mit-copyright.h>. */
 
 #ifndef lint
 static char *rcsid_hostname_c = "$Header$";
 #endif lint
 
 /* PrincipalHostname, borrowed from rcmd.c in Kerberos code */
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <netdb.h>
 #include <ctype.h>
-#include <strings.h>
+#include <string.h>
 char *
 PrincipalHostname(alias)
      char *alias;
@@ -21,7 +25,7 @@ PrincipalHostname(alias)
      struct hostent *h;
      char *phost = alias;
      if ((h=gethostbyname(alias)) != (struct hostent *)NULL) {
-         char *p = index(h->h_name, '.');
+         char *p = strchr(h->h_name, '.');
          if (p)
               *p = NULL;
          p = phost = h->h_name;
This page took 0.054319 seconds and 4 git commands to generate.