diff options
Diffstat (limited to 'hw1/xwrap.c')
-rw-r--r-- | hw1/xwrap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw1/xwrap.c b/hw1/xwrap.c index 85991ae..dfdf2c8 100644 --- a/hw1/xwrap.c +++ b/hw1/xwrap.c @@ -107,5 +107,9 @@ char* xgetcwd (void) { cwd = xrealloc (cwd, size); } + if (result == NULL) { + strncpy (cwd, "<Unknown working directory>", size - 1); + } + return cwd; } |