diff options
author | David Robillard <d@drobilla.net> | 2022-09-01 23:55:07 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-09-02 00:05:26 -0400 |
commit | afc6ef7e54988fd68f33df21ec2a220e6bfc49f4 (patch) | |
tree | 6dcef700e8a4a806d71162f56ef0585e4cc19993 /src/allocator.c | |
parent | 1a4a2c607782eac013088ea8afb5a899e72b1f22 (diff) | |
download | zix-afc6ef7e54988fd68f33df21ec2a220e6bfc49f4.tar.gz zix-afc6ef7e54988fd68f33df21ec2a220e6bfc49f4.tar.bz2 zix-afc6ef7e54988fd68f33df21ec2a220e6bfc49f4.zip |
Improve test coverage
Diffstat (limited to 'src/allocator.c')
-rw-r--r-- | src/allocator.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/allocator.c b/src/allocator.c index ca91803..af6b8a9 100644 --- a/src/allocator.c +++ b/src/allocator.c @@ -60,9 +60,10 @@ zix_default_aligned_alloc(ZixAllocator* const allocator, #if defined(_WIN32) return _aligned_malloc(size, alignment); #elif USE_POSIX_MEMALIGN - void* ptr = NULL; - const int ret = posix_memalign(&ptr, alignment, size); - return ret ? NULL : ptr; + // POSIX.1-2008 TC2 says that ptr is not modified on failure + void* ptr = NULL; + posix_memalign(&ptr, alignment, size); + return ptr; #else return NULL; #endif |