Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 6 Feb 2005 12:05:30 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: gethostbyname() problem? Message-ID: <20050206110530.GR19096@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <200502051240 DOT j15CevQ32345 AT webmail DOT web-mania DOT com> <4205D6D1 DOT 70D38D40 AT dessent DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4205D6D1.70D38D40@dessent.net> User-Agent: Mutt/1.4.2i On Feb 6 00:35, Brian Dessent wrote: > Index: src/winsup/cygwin/net.cc > =================================================================== > RCS file: /cvs/src/src/winsup/cygwin/net.cc,v > retrieving revision 1.175 > diff -u -p -r1.175 net.cc > --- src/winsup/cygwin/net.cc 19 Aug 2004 10:58:37 -0000 1.175 > +++ src/winsup/cygwin/net.cc 6 Feb 2005 08:14:41 -0000 > @@ -940,13 +940,13 @@ cygwin_gethostbyname (const char *name) > static struct hostent tmp; > static char *tmp_aliases[1]; > static char *tmp_addr_list[2]; > - static int a, b, c, d; > + static int a, b, c, d, n; > > sig_dispatch_pending (); > if (check_null_str_errno (name)) > return NULL; > > - if (sscanf (name, "%d.%d.%d.%d", &a, &b, &c, &d) == 4) > + if (sscanf (name, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4 && (unsigned)n == strlen (name)) > { > /* In case you don't have DNS, at least x.x.x.x still works */ > memset (&tmp, 0, sizeof (tmp)); Thanks for the patch, Brian. Do you also have a nice ChangeLog entry for me? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/