diff options
author | David Robillard <d@drobilla.net> | 2022-11-12 16:38:55 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-12 16:38:55 -0500 |
commit | 68c1cdeb51bcac4e6d55e450b955a197cd6d0b42 (patch) | |
tree | 8bbbea978755a56752195f19c0a1dafb6ed86475 /src | |
parent | bd0105f64fb4ed62aae26be82d325ec70066886b (diff) | |
download | zix-68c1cdeb51bcac4e6d55e450b955a197cd6d0b42.tar.gz zix-68c1cdeb51bcac4e6d55e450b955a197cd6d0b42.tar.bz2 zix-68c1cdeb51bcac4e6d55e450b955a197cd6d0b42.zip |
Fix zix_current_path() on systems with a static PATH_MAX
Diffstat (limited to 'src')
-rw-r--r-- | src/posix/filesystem_posix.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c index c5a783c..3bc5458 100644 --- a/src/posix/filesystem_posix.c +++ b/src/posix/filesystem_posix.c @@ -428,7 +428,8 @@ 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}; - return copy_path(allocator, getcwd(buffer, PATH_MAX), strlen(buffer)); + 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 |