From 55011d4bfd46c920580d1aa6663bcfdb1e996d3e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 18 Apr 2017 14:11:15 -0700 Subject: Use a different way to get the size of structs with flexible array members --- Alc/hrtf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Alc/hrtf.c') diff --git a/Alc/hrtf.c b/Alc/hrtf.c index 23817d66..3047915b 100644 --- a/Alc/hrtf.c +++ b/Alc/hrtf.c @@ -688,7 +688,7 @@ static void AddFileEntry(vector_EnumeratedHrtf *list, const_al_string filename) TRACE("Got new file \"%s\"\n", alstr_get_cstr(filename)); loaded_entry = al_calloc(DEF_ALIGN, - offsetof(struct HrtfEntry, filename[alstr_length(filename)+1]) + FAM_SIZE(struct HrtfEntry, filename, alstr_length(filename)+1) ); loaded_entry->next = LoadedHrtfs; loaded_entry->handle = NULL; @@ -769,7 +769,7 @@ static void AddBuiltInEntry(vector_EnumeratedHrtf *list, const_al_string filenam TRACE("Got new file \"%s\"\n", alstr_get_cstr(filename)); loaded_entry = al_calloc(DEF_ALIGN, - offsetof(struct HrtfEntry, filename[namelen]) + FAM_SIZE(struct HrtfEntry, filename, namelen) ); loaded_entry->next = LoadedHrtfs; loaded_entry->handle = hrtf; -- cgit v1.2.3