delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/06/06:05:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <corinna-cygwin AT cygwin DOT com>
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
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019