delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/12/18:40:27

Message-Id: <199711122340.SAA13067@delorie.com>
From: "sl" <SL AT usemail DOT com>
To: "DJGPP mailing list" <djgpp AT delorie DOT com>
Date: Wed, 12 Nov 97 18:44:49
Reply-To: "sl" <SL AT usemail DOT com>
MIME-Version: 1.0
Subject: getcwd()

Hi,

	I just thought of something. Since getcwd(NULL, 0) malloc()s its own variable. Does executing the 
following code pose a problem?

(...)
  char result[MAX_PATH];
  strcmp(result, getcwd(NULL, 0));
(...)

	Does this cause a pointer to be lost forever? Is a "free()" missing here on the result of getcwd()?

Gili

- Raw text -


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