M2: getcwd

This commit is contained in:
Jan Nieuwenhuizen 2019-10-26 09:12:47 +02:00
parent c2ba415b1f
commit c4c92c64cb
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 3 additions and 3 deletions

View File

@ -28,10 +28,10 @@
char *
getcwd (char *buffer, int size)
{
if (! __itoa_buf)
__itoa_buf = malloc (20);
if (__getcwd_buf == 0)
__getcwd_buf = malloc (PATH_MAX);
char *buf = __itoa_buf;
if (buffer)
if (buffer != 0)
return _getcwd (buffer, size);
return _getcwd (buf, PATH_MAX);
}