home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 48
/
Amiga_Dream_48.iso
/
Atari
/
c
/
sozobon-v2
/
dlibsrc.lha
/
GETCWD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-05-22
|
334b
|
19 lines
#include <stdio.h>
#include <limits.h>
#include <malloc.h>
char *getcwd(buf, limit)
char *buf;
register int limit;
{
char cwd[PATHSIZE], *strcpy();
if((buf == NULL)
&& ((buf = malloc(limit)) == NULL))
return(NULL);
fullpath(cwd, "");
if(strlen(cwd) < limit)
return(strcpy(buf, cwd));
return(NULL);
}