diff options
author | David Robillard <d@drobilla.net> | 2023-12-15 15:40:50 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-15 15:40:50 -0500 |
commit | df4674400428ff3fc03c08534a99cfbd3bb54f91 (patch) | |
tree | 3d6656f5ad0ba2b8cbe6fadb9651b26c01d984d9 /include | |
parent | 08954c900820320064d2e33445858e1ef5024a0b (diff) | |
download | zix-df4674400428ff3fc03c08534a99cfbd3bb54f91.tar.gz zix-df4674400428ff3fc03c08534a99cfbd3bb54f91.tar.bz2 zix-df4674400428ff3fc03c08534a99cfbd3bb54f91.zip |
Fix nullability annotations for zix_canonical_path() and friends
These functions can (and likely will) fail due to filesystem operations
failing, rather than a (rare) failed allocation, so they should be nullable so
clang can find potential null dereferences.
Diffstat (limited to 'include')
-rw-r--r-- | include/zix/filesystem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/zix/filesystem.h b/include/zix/filesystem.h index e07b579..9abafe1 100644 --- a/include/zix/filesystem.h +++ b/include/zix/filesystem.h @@ -147,7 +147,7 @@ zix_create_directory_symlink(const char* ZIX_NONNULL target_path, @return The path of the created directory, or null. */ ZIX_API -char* ZIX_ALLOCATED +char* ZIX_NULLABLE zix_create_temporary_directory(ZixAllocator* ZIX_NULLABLE allocator, const char* ZIX_NONNULL path_pattern); @@ -228,7 +228,7 @@ zix_file_equals(ZixAllocator* ZIX_NULLABLE allocator, @return A new canonical version of `path`, or null if it doesn't exist. */ ZIX_API -char* ZIX_ALLOCATED +char* ZIX_NULLABLE zix_canonical_path(ZixAllocator* ZIX_NULLABLE allocator, const char* ZIX_NULLABLE path); |