install C version of _doprnt
[unix-history] / usr / src / lib / libc / net / inet_network.c
index f4d9712..edcf69e 100644 (file)
@@ -1,14 +1,21 @@
 /*
  * Copyright (c) 1983 Regents of the University of California.
 /*
  * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c     5.2 (Berkeley) %G%";
-#endif LIBC_SCCS and not lint
+static char sccsid[] = "@(#)inet_network.c     5.4 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 
 #include <sys/types.h>
+#include <netinet/in.h>
 #include <ctype.h>
 
 /*
 #include <ctype.h>
 
 /*
@@ -46,16 +53,16 @@ again:
        }
        if (*cp == '.') {
                if (pp >= parts + 4)
        }
        if (*cp == '.') {
                if (pp >= parts + 4)
-                       return (-1);
+                       return (INADDR_NONE);
                *pp++ = val, cp++;
                goto again;
        }
        if (*cp && !isspace(*cp))
                *pp++ = val, cp++;
                goto again;
        }
        if (*cp && !isspace(*cp))
-               return (-1);
+               return (INADDR_NONE);
        *pp++ = val;
        n = pp - parts;
        if (n > 4)
        *pp++ = val;
        n = pp - parts;
        if (n > 4)
-               return (-1);
+               return (INADDR_NONE);
        for (val = 0, i = 0; i < n; i++) {
                val <<= 8;
                val |= parts[i] & 0xff;
        for (val = 0, i = 0; i < n; i++) {
                val <<= 8;
                val |= parts[i] & 0xff;