J
Joachim Schmitz
as per the manual:This require dynamic memory to hold path length, tough to predict. If
less, lost. If more segfault.
Better try
char * get_current_dir_name(void);
which calls malloc by itself...
char *getcwd(char *buffer, size_t size)
....
if the buffer parameter is a null pointer, getcwd() uses the malloc()
function to allocate a buffer from the heap of the calling process
getcwd() is POSIX, get_current_dir_name() isn't part of any standard, is it?
Bye, Jojo