diff options
Diffstat (limited to 'lib/time_rz.c')
-rw-r--r-- | lib/time_rz.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/time_rz.c b/lib/time_rz.c index 612093bbc..c6e6083a6 100644 --- a/lib/time_rz.c +++ b/lib/time_rz.c @@ -1,6 +1,6 @@ /* Time zone functions such as tzalloc and localtime_rz - Copyright 2015-2016 Free Software Foundation, Inc. + Copyright 2015-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -32,6 +32,7 @@ #include <stdlib.h> #include <string.h> +#include "flexmember.h" #include "time-internal.h" #if !HAVE_TZSET @@ -94,7 +95,7 @@ tzalloc (char const *name) { size_t name_size = name ? strlen (name) + 1 : 0; size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; - timezone_t tz = malloc (offsetof (struct tm_zone, abbrs) + abbr_size); + timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); if (tz) { tz->next = NULL; |