/*
- * "$Id: http-addrlist.c 5679 2006-06-20 14:45:15Z mike $"
+ * "$Id: http-addrlist.c 6649 2007-07-11 21:46:42Z mike $"
*
* HTTP address list routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2008 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* Create the socket...
*/
- if ((*sock = socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
+ if ((*sock = (int)socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
{
/*
* Don't abort yet, as this could just be an issue with the local
#ifdef DEBUG
- printf("httpAddrGetList(hostname=\"%s\", family=AF_%s, service=\"%s\")\n",
- hostname ? hostname : "(nil)",
- family == AF_UNSPEC ? "UNSPEC" :
+ _cups_debug_printf("httpAddrGetList(hostname=\"%s\", family=AF_%s, "
+ "service=\"%s\")\n",
+ hostname ? hostname : "(nil)",
+ family == AF_UNSPEC ? "UNSPEC" :
# ifdef AF_LOCAL
- family == AF_LOCAL ? "LOCAL" :
+ family == AF_LOCAL ? "LOCAL" :
# endif /* AF_LOCAL */
# ifdef AF_INET6
- family == AF_INET6 ? "INET6" :
+ family == AF_INET6 ? "INET6" :
# endif /* AF_INET6 */
- family == AF_INET ? "INET" : "???", service);
+ family == AF_INET ? "INET" : "???", service);
#endif /* DEBUG */
/*
* Domain socket address...
*/
- first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t));
- first->addr.un.sun_family = AF_LOCAL;
- strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path));
+ if ((first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t))) != NULL)
+ {
+ first->addr.un.sun_family = AF_LOCAL;
+ strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path));
+ }
}
else
#endif /* AF_LOCAL */
*/
strlcpy(ipv6, hostname + 4, sizeof(ipv6));
- if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
+ if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
{
ipv6[ipv6len] = '\0';
hostname = ipv6;
*/
strlcpy(ipv6, hostname + 1, sizeof(ipv6));
- if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
+ if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
{
ipv6[ipv6len] = '\0';
hostname = ipv6;
/*
- * End of "$Id: http-addrlist.c 5679 2006-06-20 14:45:15Z mike $".
+ * End of "$Id: http-addrlist.c 6649 2007-07-11 21:46:42Z mike $".
*/