]> Savannah Git Hosting - gnulib.git/commitdiff
time_rz: Use idx_t for nonnegative ptrdiff_t variables.
authorBruno Haible <bruno@clisp.org>
Sun, 6 Dec 2020 11:31:13 +0000 (12:31 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 6 Dec 2020 11:31:13 +0000 (12:31 +0100)
* lib/time_rz.c: Include idx.h.
(save_abbr): Mark zone_size as nonnegative.
* modules/time_rz (Depends-on): Add idx.

ChangeLog
lib/time_rz.c
modules/time_rz

index b6b6a37fc154cafe96051da76fcab17b5428358a..139c384a79e479fda8c9e88a4d024e43d6081aaa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-06  Bruno Haible  <bruno@clisp.org>
+
+       time_rz: Use idx_t for nonnegative ptrdiff_t variables.
+       * lib/time_rz.c: Include idx.h.
+       (save_abbr): Mark zone_size as nonnegative.
+       * modules/time_rz (Depends-on): Add idx.
+
 2020-12-06  Bruno Haible  <bruno@clisp.org>
 
        parse-datetime: Use idx_t for nonnegative ptrdiff_t variables.
index a33b8078bf8c27469423d2bf80e97eceb91d8241..6e70ca9ff917a31d49d56509bd5d33515caba7a4 100644 (file)
@@ -33,6 +33,7 @@
 #include <string.h>
 
 #include "flexmember.h"
+#include "idx.h"
 #include "time-internal.h"
 
 /* The approximate size to use for small allocation requests.  This is
@@ -120,7 +121,7 @@ save_abbr (timezone_t tz, struct tm *tm)
         {
           if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set)))
             {
-              ptrdiff_t zone_size = strlen (zone) + 1;
+              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
index 699a61d56fcf3cacf7859c2cb5309726943e13eb..6a2b23c8cc605e58bf8b9e9175f0e1202b1fd6b4 100644 (file)
@@ -22,6 +22,7 @@ c99
 extensions
 time
 flexmember     [test $HAVE_TIMEZONE_T = 0]
+idx            [test $HAVE_TIMEZONE_T = 0]
 setenv         [test $HAVE_TIMEZONE_T = 0]
 stdbool        [test $HAVE_TIMEZONE_T = 0]
 time_r         [test $HAVE_TIMEZONE_T = 0]