From: Junio C Hamano Date: Fri, 27 Jul 2007 20:51:44 GMT Subject: Re: [PATCH 2/8] Add functions get_relative_cwd() and is_inside_dir() Message-ID: <7vps2dy3hb.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > +char *get_relative_cwd(char *buffer, int size, const char *dir) > +{ > + char *cwd = buffer; > + > + if (!dir) > + return 0; > + > + if (!getcwd(buffer, PATH_MAX)) > + return 0; Can size be less than PATH_MAX?