summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-15 15:23:57 -0500
committerDavid Robillard <d@drobilla.net>2022-11-15 15:23:57 -0500
commit34dcea2a0d3c88cbfbb2af6645b51ef97e79c523 (patch)
tree64719b40af9360e67faa49e13ed0f0722bb7fa76
parent875df8c7f846942b61d8fc43e544045c8cbffa06 (diff)
downloadzix-34dcea2a0d3c88cbfbb2af6645b51ef97e79c523.tar.gz
zix-34dcea2a0d3c88cbfbb2af6645b51ef97e79c523.tar.bz2
zix-34dcea2a0d3c88cbfbb2af6645b51ef97e79c523.zip
Fix unused return value warning
-rw-r--r--src/posix/filesystem_posix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c
index 3bc5458..c730b21 100644
--- a/src/posix/filesystem_posix.c
+++ b/src/posix/filesystem_posix.c
@@ -428,8 +428,9 @@ zix_current_path(ZixAllocator* const allocator)
#if defined(PATH_MAX)
// Some POSIX systems have a static PATH_MAX so we can store it on the stack
char buffer[PATH_MAX] = {0};
- getcwd(buffer, PATH_MAX);
- return copy_path(allocator, buffer, strlen(buffer));
+ if (getcwd(buffer, PATH_MAX)) {
+ return copy_path(allocator, buffer, strlen(buffer));
+ }
#elif USE_PATHCONF
// Others don't so we have to query PATH_MAX at runtime to allocate the result