diff options
author | Philipp Stephani <phst@google.com> | 2020-12-24 16:48:40 +0100 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2020-12-24 16:48:40 +0100 |
commit | 29064d02c31b08ae41d41a93fd1439718373b196 (patch) | |
tree | 6c976729d7c6f296b36965f235d2a58e8142393e /lib/time_rz.c | |
parent | 26b8b30ff42568ff3e3f8599a20328a1efe93d2a (diff) |
Update Gnulib.
All changes in this commit are autogenerated by running
admin/merge-gnulib.
Diffstat (limited to 'lib/time_rz.c')
-rw-r--r-- | lib/time_rz.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/time_rz.c b/lib/time_rz.c index 95438cf876e..8992c2e37e0 100644 --- a/lib/time_rz.c +++ b/lib/time_rz.c @@ -27,19 +27,15 @@ #include <time.h> #include <errno.h> -#include <limits.h> #include <stdbool.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include "flexmember.h" +#include "idx.h" #include "time-internal.h" -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* The approximate size to use for small allocation requests. This is the largest "small" request for the GNU C library malloc. */ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 }; @@ -125,14 +121,8 @@ save_abbr (timezone_t tz, struct tm *tm) { if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set))) { - size_t zone_size = strlen (zone) + 1; - size_t zone_used = zone_copy - tz->abbrs; - if (SIZE_MAX - zone_used < zone_size) - { - errno = ENOMEM; - return false; - } - if (zone_used + zone_size < ABBR_SIZE_MIN) + idx_t zone_size = strlen (zone) + 1; + if (zone_size < tz->abbrs + ABBR_SIZE_MIN - zone_copy) extend_abbrs (zone_copy, zone, zone_size); else { |