From 34dcea2a0d3c88cbfbb2af6645b51ef97e79c523 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Nov 2022 15:23:57 -0500 Subject: Fix unused return value warning --- src/posix/filesystem_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.1