delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/05/08:26:44

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, 5 Oct 2001 16:23:52 +0400
From: egor duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.53 RC/4)
Reply-To: egor duda <cygwin AT cygwin DOT com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <17911642410.20011005162352@logos-m.ru>
To: Yasushi Higuchi <yzone AT mail DOT raidway DOT ne DOT jp>
CC: cygwin AT cygwin DOT com
Subject: Re: getcwd() problem
In-Reply-To: <200110051213.VAA12158@mail.raidway.ne.jp>
References: <200110051213 DOT VAA12158 AT mail DOT raidway DOT ne DOT jp>
MIME-Version: 1.0

Hi!

Friday, 05 October, 2001 Yasushi Higuchi yzone AT mail DOT raidway DOT ne DOT jp wrote:

YH> I found a problem in the getcwd() function in recent snapshot.

[...]
>>    char *cwd = getcwd(NULL, 256);
[...]

Single Unix Specification v2 says that "If buf is a null pointer, the
behaviour of getcwd() is undefined."

YH> Reference: FreeBSD manpages
>>STANDARDS
>>The getcwd() function conforms to ISO 9899: 1990 (``ISO C''). The ability
>>to specify a NULL pointer and have getcwd() allocate memory as necessary
>>is an extension.

cygwin doesn't support this extension. it's arguable whether it should
be added or not. code that implicitly allocates (on doesn't allocate,
depending in parameters) memory on heap is a source of potential
memory leaks.

Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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