delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/11/12:26:35

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 11 Aug 2000 12:25:29 -0400
From: "'cgf AT cygnus DOT com'" <cgf AT cygnus DOT com>
To: Eric Hanchrow <erich AT votehere DOT net>
Cc: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: 1.1.2: snprintf writes one too many characters
Message-ID: <20000811122529.A19863@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: Eric Hanchrow <erich AT votehere DOT net>,
"'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
References: <0102AE2D3200D4118AE20050DACDB02E017367 AT congress DOT vhcorp DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.6i
In-Reply-To: <0102AE2D3200D4118AE20050DACDB02E017367@congress.vhcorp.com>; from erich@votehere.net on Fri, Aug 11, 2000 at 09:22:49AM -0700

On Fri, Aug 11, 2000 at 09:22:49AM -0700, Eric Hanchrow wrote:
>In http://sources.redhat.com/ml/cygwin/2000-08/msg00276.html Doug and cgf
>write:
>    ...
>
>    >on Linux and HP-UX, when the string exceeds 'size' then (size - 1)
>    >chars plus a NUL are written, but on Cygwin 'size' chars are written
>    >and a NUL is placed into target[size]
>
>    It sounds like a bug to me.
>
>And it sounds like a bug to the GNU Configure script (at least, the
>version that comes with
>ftp://download.sourceforge.net/pub/mirrors/OpenBSD/OpenSSH/portable/openssh-
>2.1.1p4.tar.gz).
>That script reproduces the problem with this little C program:
>
>    #include <stdio.h>
>    int main(void)
>    {
>      char b[5];
>      snprintf(b,5,"123456789");
>      return(b[4]!='\0');
>    }
>
>The correct return value is 0, but on Cygwin, we get non-zero.
>
>This problem prevents me from building openssh.

This has already been noted.

The problem is fixed in the newlib CVS repository.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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