diff options
author | Taylor Holberton <tay10r@protonmail.com> | 2020-06-03 17:58:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 17:58:27 -0400 |
commit | 88a791f68b35ca0e4c7979d24cc9954422168dcd (patch) | |
tree | 6591ca234a5167c3fdfa62bcd7a135d3c7904895 | |
parent | ab224a09018d7547eff304c44e4b2334d87aea3b (diff) | |
parent | 8605d2ae8f235926784ec7a557382eb23574f342 (diff) |
Merge pull request #160 from E5ten/posix_memalign
tinywavinfo: replace obsolete memalign with posix_memalign
-rw-r--r-- | utils/tinywavinfo.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/utils/tinywavinfo.c b/utils/tinywavinfo.c index 99ee5da..c316060 100644 --- a/utils/tinywavinfo.c +++ b/utils/tinywavinfo.c @@ -32,7 +32,6 @@ #include <string.h> #include <signal.h> #include <math.h> -#include <malloc.h> #define ID_RIFF 0x46464952 #define ID_WAVE 0x45564157 @@ -155,9 +154,8 @@ void analyse_sample(FILE *file, unsigned int channels, unsigned int bits, normalization_factor = (float)pow(2.0, (bits-1)); size = channels * byte_align * frame_size; - buffer = memalign(byte_align, size); - if (!buffer) { + if (posix_memalign(&buffer, byte_align, size)) { fprintf(stderr, "Unable to allocate %d bytes\n", size); free(buffer); return; |