[cups.bugs] [LOW] STR #1243: fix for a warning about an
Alexander Stohr
stohr at schwab-gft.de
Fri Aug 12 14:16:43 PDT 2005
[STR New]
if the adress list is for some reasons empty,
then the variable fd will not get initialized.
the below patch will init it to "failed".
-Alex.
diff -u -U 8 file.c.orig file.c
--- file.c.orig 2005-08-01 17:22:25.000000000 +0200
+++ file.c 2005-08-12 15:55:39.000000000 +0200
@@ -477,16 +477,17 @@
if (isdigit(portname[0] & 255))
port = atoi(portname);
else if ((service = getservbyname(portname, NULL)) != NULL)
port = ntohs(service->s_port);
else
return (NULL);
+ fd = -1;
for (i = 0; hostaddr->h_addr_list[i]; i ++)
{
/*
* Load the address...
*/
httpAddrLoad(hostaddr, port, i, &sockaddr);
Link: http://www.cups.org/str.php?L1243
Version: 1.2-feature
More information about the cups-devel
mailing list