]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
Use strnul in a few places.
authorAlejandro Colomar <alx@kernel.org>
Tue, 24 Feb 2026 01:59:14 +0000 (02:59 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 24 Feb 2026 01:59:14 +0000 (02:59 +0100)
* lib/argz.c (argz_next): Use strnul.
* lib/cpu-supports.c (hwcap_allowed): Likewise.
* lib/file-has-acl.c (aclinfo_has_xattr): Likewise.
* lib/inet_ntop.c (inet_ntop6): Likewise.
* lib/link.c (link): Likewise.
* lib/localename-unsafe.c (enum_locales_fn): Likewise.
* lib/mbspcasecmp.c (mbspcasecmp): Likewise.
* lib/opendir.c (opendir): Likewise.
* lib/parse-duration.c (parse_year_month_day, parse_hour_minute_second,
trim): Likewise.
* lib/setlocale.c (setlocale_unixlike): Likewise.
* lib/strftime.c (__strftime_internal): Likewise.
* lib/striconv.c (str_cd_iconv): Likewise.
* lib/strncat.c (strncat): Likewise.
* lib/term-style-control.c (log_signal_handler_called,
tcsetattr_failed): Likewise.
* lib/time_rz.c (save_abbr): Likewise.
* lib/vc-mtime.c (git_mtime, max_vc_mtime): Likewise.
* tests/test-savedir.c (test_savedir_sort_none, test_savedir_sort_name):
Likewise.
* modules/argz (Depends-on): Add strnul.
* modules/cpu-supports (Depends-on): Likewise.
* modules/file-has-acl (Depends-on): Likewise.
* modules/inet_ntop (Depends-on): Likewise.
* modules/link (Depends-on): Likewise.
* modules/localename-unsafe (Depends-on): Likewise.
* modules/localename-unsafe-limited (Depends-on): Likewise.
* modules/mbspcasecmp (Depends-on): Likewise.
* modules/opendir (Depends-on): Likewise.
* modules/parse-duration (Depends-on): Likewise.
* modules/setlocale (Depends-on): Likewise.
* modules/nstrftime (Depends-on): Likewise.
* modules/nstrftime-limited (Depends-on): Likewise.
* modules/c-nstrftime (Depends-on): Likewise.
* modules/fprintftime (Depends-on): Likewise.
* modules/striconv (Depends-on): Likewise.
* modules/strncat (Depends-on): Likewise.
* modules/term-style-control (Depends-on): Likewise.
* modules/time_rz (Depends-on): Likewise.
* modules/vc-mtime (Depends-on): Likewise.
* modules/savedir-tests (Depends-on): Likewise.

Copyright-paperwork-exempt: Yes

39 files changed:
ChangeLog
lib/argz.c
lib/cpu-supports.c
lib/file-has-acl.c
lib/inet_ntop.c
lib/link.c
lib/localename-unsafe.c
lib/mbspcasecmp.c
lib/opendir.c
lib/parse-duration.c
lib/setlocale.c
lib/strftime.c
lib/striconv.c
lib/strncat.c
lib/term-style-control.c
lib/time_rz.c
lib/vc-mtime.c
modules/argz
modules/c-nstrftime
modules/cpu-supports
modules/file-has-acl
modules/fprintftime
modules/inet_ntop
modules/link
modules/localename-unsafe
modules/localename-unsafe-limited
modules/mbspcasecmp
modules/nstrftime
modules/nstrftime-limited
modules/opendir
modules/parse-duration
modules/savedir-tests
modules/setlocale
modules/striconv
modules/strncat
modules/term-style-control
modules/time_rz
modules/vc-mtime
tests/test-savedir.c

index 5a43de5cbcc8b438085336073ba7e33a0c6c5937..0de1d9161792ecdc802691ceda4f2b0f2d7c4da7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+2026-02-23  Alejandro Colomar  <alx@kernel.org>
+
+       Use strnul in a few places.
+       * lib/argz.c (argz_next): Use strnul.
+       * lib/cpu-supports.c (hwcap_allowed): Likewise.
+       * lib/file-has-acl.c (aclinfo_has_xattr): Likewise.
+       * lib/inet_ntop.c (inet_ntop6): Likewise.
+       * lib/link.c (link): Likewise.
+       * lib/localename-unsafe.c (enum_locales_fn): Likewise.
+       * lib/mbspcasecmp.c (mbspcasecmp): Likewise.
+       * lib/opendir.c (opendir): Likewise.
+       * lib/parse-duration.c (parse_year_month_day, parse_hour_minute_second,
+       trim): Likewise.
+       * lib/setlocale.c (setlocale_unixlike): Likewise.
+       * lib/strftime.c (__strftime_internal): Likewise.
+       * lib/striconv.c (str_cd_iconv): Likewise.
+       * lib/strncat.c (strncat): Likewise.
+       * lib/term-style-control.c (log_signal_handler_called,
+       tcsetattr_failed): Likewise.
+       * lib/time_rz.c (save_abbr): Likewise.
+       * lib/vc-mtime.c (git_mtime, max_vc_mtime): Likewise.
+       * tests/test-savedir.c (test_savedir_sort_none, test_savedir_sort_name):
+       Likewise.
+       * modules/argz (Depends-on): Add strnul.
+       * modules/cpu-supports (Depends-on): Likewise.
+       * modules/file-has-acl (Depends-on): Likewise.
+       * modules/inet_ntop (Depends-on): Likewise.
+       * modules/link (Depends-on): Likewise.
+       * modules/localename-unsafe (Depends-on): Likewise.
+       * modules/localename-unsafe-limited (Depends-on): Likewise.
+       * modules/mbspcasecmp (Depends-on): Likewise.
+       * modules/opendir (Depends-on): Likewise.
+       * modules/parse-duration (Depends-on): Likewise.
+       * modules/setlocale (Depends-on): Likewise.
+       * modules/nstrftime (Depends-on): Likewise.
+       * modules/nstrftime-limited (Depends-on): Likewise.
+       * modules/c-nstrftime (Depends-on): Likewise.
+       * modules/fprintftime (Depends-on): Likewise.
+       * modules/striconv (Depends-on): Likewise.
+       * modules/strncat (Depends-on): Likewise.
+       * modules/term-style-control (Depends-on): Likewise.
+       * modules/time_rz (Depends-on): Likewise.
+       * modules/vc-mtime (Depends-on): Likewise.
+       * modules/savedir-tests (Depends-on): Likewise.
+
 2026-02-23  Bruno Haible  <bruno@clisp.org>
 
        strnul: Respect GNULIB_NAMESPACE.
index 55303dfb19da1e6fc739b85aa3b1bb852c57a985..0d36c741d931e6a66706564df93f6543aa2e1e71 100644 (file)
@@ -175,7 +175,7 @@ argz_next (const char *argz, size_t argz_len, const char *entry)
   if (entry)
     {
       if (entry < argz + argz_len)
-        entry = strchr (entry, '\0') + 1;
+        entry = strnul (entry) + 1;
 
       return entry >= argz + argz_len ? NULL : (char *) entry;
     }
index 9057d151eba60e1bcaaa08b402cb2aeb304a2e51..a1505f8bd69098104cf45dff349797054f99c531 100644 (file)
@@ -66,7 +66,7 @@ hwcap_allowed (char const *glibc_hwcap)
 
   char const *sentinel = strchr (hwcaps, ':');
   if (! sentinel)
-    sentinel = hwcaps + strlen (hwcaps);
+    sentinel = strnul (hwcaps);
   char const *cap = hwcaps;
   while ((cap = strstr (cap, glibc_hwcap)) && cap < sentinel)
     { /* Check it's not a partial match.  */
index 26d3e358de7a46d74d6dc1d5a38faab422f1be9c..3269d7f71b7e724fa05dd3223e3c948226ca8de0 100644 (file)
@@ -145,7 +145,7 @@ aclinfo_has_xattr (struct aclinfo const *ai, char const *xattr)
   if (0 < ai->size)
     {
       char const *blim = ai->buf + ai->size;
-      for (char const *b = ai->buf; b < blim; b += strlen (b) + 1)
+      for (char const *b = ai->buf; b < blim; b = strnul (b) + 1)
         for (char const *a = xattr; *a == *b; a++, b++)
           if (!*a)
             return true;
index 599ca4fb723a16f39bedf5d9341c3b4226014743..dff25c5f6d337bfcb4bda2166fc46fbd98be5870 100644 (file)
@@ -225,7 +225,7 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
         {
           if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
             return (NULL);
-          tp += strlen (tp);
+          tp = strnul (tp);
           break;
         }
       {
index 9053eef28f156d7e714eb564f0319543d635508c..6198929943d848e21a58e85bcaa96b4efb18e33f 100644 (file)
@@ -113,7 +113,7 @@ link (const char *file1, const char *file2)
     return -1;
   {
     struct stat st;
-    char *p = strchr (dir, '\0');
+    char *p = strnul (dir);
     while (dir < p && (*--p != '/' && *p != '\\'));
     *p = '\0';
     if (p != dir && stat (dir, &st) != 0 && errno != EOVERFLOW)
index 12748cba28becd2c8a999c8695cb42e0d0348940..d490fe89bee4501925f8f880c11ea7df24267b88 100644 (file)
@@ -2558,7 +2558,7 @@ enum_locales_fn (LPSTR locale_num_str)
     {
       strcat (locval, "_");
       if (GetLocaleInfo (try_lcid, LOCALE_SENGCOUNTRY,
-                        locval + strlen (locval), LOCALE_NAME_MAX_LENGTH))
+                        strnul (locval), LOCALE_NAME_MAX_LENGTH))
        {
          size_t locval_len = strlen (locval);
 
index 696cb89fb2940b4c18b9277d34a9e7e4e6e7180d..a72a20d4fe91b38bf23489f6fcc7272c4e30e3fb 100644 (file)
@@ -45,7 +45,7 @@ mbspcasecmp (const char *string, const char *prefix)
        mbsncasecmp (string, prefix, mbslen (prefix))
      just with small optimizations.  */
   if (string == prefix)
-    return (char *) (string + strlen (string));
+    return (char *) strnul (string);
 
   const char *iter1 = string;
   const char *iter2 = prefix;
index 3890206b7912d19ea5d039bb30bc6cb1d1eecc6e..ea3d2ef1662edacc2891cee979bb50fdec4b7916 100644 (file)
@@ -111,7 +111,7 @@ opendir (const char *dir_name)
   {
     char *p;
 
-    p = dir_name_mask + strlen (dir_name_mask);
+    p = strnul (dir_name_mask);
     if (p > dir_name_mask && !ISSLASH (p[-1]))
       *p++ = '\\';
     *p++ = '*';
index 5bea54f4e6ce79132c46d22fe2d9a815ef005e6b..5abf6a1331938e45b38d599399419d39340b6bed 100644 (file)
@@ -192,7 +192,7 @@ parse_year_month_day (cch_t * pz, cch_t * ps)
   res = parse_scaled_value (res, &pz, ps, SEC_PER_MONTH);
 
   pz++; /* over the second '-' */
-  ps = pz + strlen (pz);
+  ps = strnul (pz);
   return parse_scaled_value (res, &pz, ps, SEC_PER_DAY);
 }
 
@@ -292,7 +292,7 @@ parse_hour_minute_second (cch_t * pz, cch_t * ps)
   res = parse_scaled_value (res, &pz, ps, SEC_PER_MIN);
 
   pz++;
-  ps = pz + strlen (pz);
+  ps = strnul (pz);
   return parse_scaled_value (res, &pz, ps, 1);
 }
 
@@ -408,7 +408,7 @@ trim (char * pz)
 
   /* trim trailing white space */
   {
-    char * pe = pz + strlen (pz);
+    char * pe = strnul (pz);
     while ((pe > pz) && isspace ((unsigned char)pe[-1]))
       pe--;
     *pe = NUL;
index c4f006105d17f0e26fcb57d87e9d71997cc650e3..3871a3fa1635967fd34dbf2bb0f7c855f3c853d0 100644 (file)
@@ -767,7 +767,7 @@ setlocale_unixlike (int category, const char *locale)
             const char *territory_start = underscore + 1;
             const char *territory_end = strchr (territory_start, '@');
             if (territory_end == NULL)
-              territory_end = territory_start + strlen (territory_start);
+              territory_end = strnul (territory_start);
 
             char ll_buf[64];
             memcpy (ll_buf, llCC_buf, underscore - llCC_buf);
index 8d32023729ce99f0a8c19280d035ca048682f331..33fa2e017bb97eb9e534c324ca70426b7e2a67ee 100644 (file)
@@ -1358,7 +1358,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
             mbstate_t mbstate = mbstate_zero;
 
             if (! format_end)
-              format_end = f + strlen (f) + 1;
+              format_end = strnul (f) + 1;
             size_t fsize = format_end - f;
 
             size_t len = 0;
index 6aded51e14997aeec4c382136f4cc0e0c1d7d916..bf169822d85839a0e32f93523b1631e5f4128f86 100644 (file)
@@ -258,7 +258,7 @@ str_cd_iconv (const char *src, iconv_t cd)
 
     for (;;)
       {
-        /* Here inptr + inbytes_remaining = src + strlen (src),
+        /* Here inptr + inbytes_remaining = strnul (src),
                 outptr + outbytes_remaining = result + result_size - 1.  */
         size_t res = iconv (cd,
                             (ICONV_CONST char **) &inptr, &inbytes_remaining,
index 5e77ea8846fda088ab5c4246439e338f0861c767..5441ac756bc39927bad1a7b62ff4c3a8816f5231 100644 (file)
@@ -23,7 +23,7 @@
 char *
 strncat (char *dest, const char *src, size_t n)
 {
-  char *destptr = dest + strlen (dest);
+  char *destptr = strnul (dest);
 
   for (; n > 0 && (*destptr = *src) != '\0'; src++, destptr++, n--)
     ;
index 9ab1c8ac087e5006533f29dfa5151651392eb164..4ed5bf7e0af09c8d25afc01de0b6978bc686dd30 100644 (file)
@@ -215,7 +215,7 @@ log_signal_handler_called (int sig)
 {
   char message[100];
   strcpy (message, "Signal handler for signal ");
-  simple_signal_string (message + strlen (message), sig);
+  simple_signal_string (strnul (message), sig);
   strcat (message, " called.\n");
   log_message (message);
 }
@@ -434,9 +434,9 @@ tcsetattr_failed (char message[100], const char *caller)
   int errnum = errno;
   strcpy (message, caller);
   strcat (message, ": tcsetattr(fd=");
-  sprintf_integer (message + strlen (message), active_fd);
+  sprintf_integer (strnul (message), active_fd);
   strcat (message, ") failed, errno=");
-  simple_errno_string (message + strlen (message), errnum);
+  simple_errno_string (strnul (message), errnum);
   strcat (message, "\n");
 }
 
index 811240e6da16adc095e9f4dcecad4c54a95969ec..0e8ea47e7916b9a46acab6c7a31c84c2c98c9ad2 100644 (file)
@@ -146,7 +146,7 @@ save_abbr (timezone_t tz, struct tm *tm)
               break;
             }
 
-          zone_copy += strlen (zone_copy) + 1;
+          zone_copy = strnul (zone_copy) + 1;
           if (!*zone_copy && tz->next)
             {
               tz = tz->next;
index ad47ef9e5ed464cc8be6552eee1a9ae738468059..208a3d2c36f19ce988388f92d2c1e7448ed17c9a 100644 (file)
@@ -250,7 +250,7 @@ git_mtime (struct timespec *mtime, const char *filename)
           char *endptr;
           unsigned long git_log_time;
           if (xstrtoul (line, &endptr, 10, &git_log_time, NULL) == LONGINT_OK
-              && endptr == line + strlen (line))
+              && endptr == strnul (line))
             {
               mtime->tv_sec = git_log_time;
               mtime->tv_nsec = 0;
@@ -885,7 +885,7 @@ max_vc_mtime (struct timespec *max_of_mtimes,
                             char *endptr;
                             unsigned long git_log_time;
                             if (!(xstrtoul (line, &endptr, 10, &git_log_time, NULL) == LONGINT_OK
-                                  && endptr == line + strlen (line)))
+                                  && endptr == strnul (line)))
                               {
                                 fprintf (stderr, "vc-mtime: git log output not as expected\n");
                                 goto git_log_fail1;
index cb8166fe4884cde2b34bb336b05d8a1e7722c74b..6f5ee3ff8fdd1bf90bce1ac37edd37002aae901e 100644 (file)
@@ -14,6 +14,7 @@ realloc-posix   [test -n "$ARGZ_H"]
 stpcpy          [test -n "$ARGZ_H"]
 strndup         [test -n "$ARGZ_H"]
 strnlen         [test -n "$ARGZ_H"]
+strnul          [test -n "$ARGZ_H"]
 strstr          [test -n "$ARGZ_H"]
 
 configure.ac:
index a0e84882fc509e65f23f161536af8c292af92a00..b60b48e1549f7ec86186a26227d2b9bc1f5b508d 100644 (file)
@@ -19,6 +19,7 @@ libc-config
 locale-h
 bool
 stdckdint-h
+strnul
 time_rz
 
 configure.ac:
index 8f5871d46f1d24a7528b000b62f0df4a24e54f8f..1e6723f865caa1f6227ca60f5cc364ffdeddf4b8 100644 (file)
@@ -10,6 +10,7 @@ attribute
 bool
 c99
 stringeq
+strnul
 
 configure.ac:
 AC_REQUIRE([AC_C_INLINE])
index a128e64483381b254ab2ad11ba1253d67cf50d14..d769f2bea4b3a70890e07d8a87c8e3d86e2b3732 100644 (file)
@@ -19,6 +19,7 @@ free-posix
 limits-h
 stdint-h
 stringeq
+strnul
 malloc-posix
 ssize_t
 stat
index 3700a3b45e5620d75f78a6d723e294c9029005a4..fd3e7073fa59d7986f4629b09ad5d5136ed3ec53 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 stdio-h
 sys_types-h
 nstrftime
+strnul
 time_rz
 
 configure.ac:
index fa6979b2ee7aab1ec50f1cc1946257abe1fb45a8..bd80bde32f04efd302d90e45008fc1603ff982fc 100644 (file)
@@ -12,6 +12,7 @@ extensions
 sys_socket-h    [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1]
 errno-h         [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1]
 netinet_in-h    [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1]
+strnul          [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1]
 
 configure.ac:
 gl_FUNC_INET_NTOP
index f7097b62d7ba768caa46041bb1151d32022d6f34..41011a9382e5a462d29b8553296c1861ee03df2c 100644 (file)
@@ -10,6 +10,7 @@ unistd-h
 free-posix      [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
 stat            [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
 strdup-posix    [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
+strnul          [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
 sys_stat-h      [test $HAVE_LINK = 0 || test $REPLACE_LINK = 1]
 
 configure.ac:
index 5785dd4462c32d4730bd0a65fe50ba230b175d9c..4545c347ea46896d7cfc2e76551d9f9b867e6a7f 100644 (file)
@@ -19,6 +19,7 @@ locale-h
 strdup
 stringeq
 strncpy
+strnul
 windows-mutex
 getlocalename_l-unsafe
 setlocale-null-unlocked
index 1593ce2784786737da82f506769c423f856d25e2..701170ebcfbf8980e04ac0431eb07981cf61469a 100644 (file)
@@ -18,6 +18,7 @@ extensions
 locale-h
 strdup
 strncpy
+strnul
 windows-mutex
 getlocalename_l-unsafe-limited
 setlocale-null-unlocked
index 29a5f051725552129e448ec6f0d23ee474bded0d..519829ce3f894cb82e55b8adde2a251730cb6f4f 100644 (file)
@@ -8,6 +8,7 @@ Depends-on:
 c32tolower
 mbuiterf
 string-h
+strnul
 
 configure.ac:
 gl_STRING_MODULE_INDICATOR([mbspcasecmp])
index 4cb87d28af707727baca12e8a8ef05c448ce73db..761f1483c0bbce425e6767546cb54b0ec7563ecd 100644 (file)
@@ -26,6 +26,7 @@ localename-unsafe [case "$host_os" in darwin*) false ;; *) true ;; esac]
 bool
 stdckdint-h
 stdint-h
+strnul
 time_rz
 
 configure.ac:
index 18fc11a51ab7d0b0b052205e2c03dd00eca4e844..c1bfef9116f072b16765c979c09713721ed1a5bc 100644 (file)
@@ -26,6 +26,7 @@ localcharset
 localename-unsafe-limited [case "$host_os" in darwin*) false ;; *) true ;; esac]
 bool
 stdckdint-h
+strnul
 time_rz
 
 configure.ac:
index b9a6dfe2d7e773e6b413abdd4ebd84c61d52ecad..631d138022b6bc74cf12a0821f595c4322ac9883 100644 (file)
@@ -13,6 +13,7 @@ filename        [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]
 unistd-h        [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]
 closedir        [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]
 dirfd           [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]
+strnul          [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]
 
 configure.ac:
 gl_FUNC_OPENDIR
index 6184dc43153d3f3f12fd6966b057b3bfeb43f649..4aa4fb2b904c59a4951e30d36a11ea240de37597 100644 (file)
@@ -7,6 +7,7 @@ lib/parse-duration.c
 
 Depends-on:
 intprops
+strnul
 
 configure.ac:
 
index 964d5be20aa1d656ff09764ec9fddaaacbbb77d4..8e5433770dc9418bc50a31e1c5a54b2ea45b12a9 100644 (file)
@@ -7,6 +7,7 @@ bool
 creat
 close
 mkdir
+strnul
 
 configure.ac:
 
index 5f718380111bc7e987edd0f5bfcc311cd3b45573..fd7403349577b383f63b44df457b6e0ade859341 100644 (file)
@@ -11,6 +11,7 @@ stringeq
 setlocale-fixes    [test $NEED_SETLOCALE_IMPROVED = 1]
 localename         [test $NEED_SETLOCALE_IMPROVED = 1]
 localename-environ [test $NEED_SETLOCALE_IMPROVED = 1]
+strnul             [test $NEED_SETLOCALE_IMPROVED = 1]
 setlocale-null     [test $NEED_SETLOCALE_MTSAFE = 1]
 
 configure.ac:
index 53b4b55ea5813f34c95de682a3fd4d888a2add22..22ff07ecb0a5723b0e44fc15c626b849dc8bbf9a 100644 (file)
@@ -10,6 +10,7 @@ iconv
 iconv_open
 free-posix
 strdup
+strnul
 c-strcasecmp
 
 configure.ac:
index 7902267c04171bcab9d524e442c1e9d36f262fd9..b2213ec5f125f4735beb7c3901420d6c7631370a 100644 (file)
@@ -8,6 +8,7 @@ m4/mmap-anon.m4
 
 Depends-on:
 string-h
+strnul
 
 configure.ac:
 gl_FUNC_STRNCAT
index 7159604ad1cc0d6e29c92bc4a93b652e1747e097..d5c1529930c3657f6cb4da60706ef505c3cfb471 100644 (file)
@@ -14,6 +14,7 @@ sigprocmask
 full-write
 fstat
 same-inode
+strnul
 xalloc-die
 
 configure.ac:
index 2479f04d1779a75a892cfa632b2e8fbcf554f041..187c477bb2420cfe4a55a8e9ec119c11f136f054 100644 (file)
@@ -16,6 +16,7 @@ idx            [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test
 setenv         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 bool           [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 stringeq       [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
+strnul         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 time_r         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 timegm         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 tzset          [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
index 44f56a4a2c17c4cfae442877b51add969afa5c65..b40ef32e6e93b52b30fe7d15ea9cb26b8c91e9dd 100644 (file)
@@ -10,6 +10,7 @@ time-h
 bool
 spawn-pipe
 stringeq
+strnul
 wait-process
 execute
 safe-read
index 95abc7833bb95135590bf1038dd06ace610ec292..c95408c52fada42feaef93a8b34e8813c40b115e 100644 (file)
@@ -44,7 +44,7 @@ test_savedir_sort_none (void)
   memset (seen, 0, sizeof seen);
 
   /* Scan through the file names.  */
-  for (char *namep = name_space; *namep != '\0'; namep += strlen (namep) + 1)
+  for (char *namep = name_space; *namep != '\0'; namep = strnul (namep) + 1)
     {
       int index = *namep - 'a';
       ASSERT (strlen (namep) == 1);
@@ -68,7 +68,7 @@ test_savedir_sort_name (void)
 
   /* Check that files "a" to "z" appear in order.  */
   for (char *namep = name_space; *namep != '\0';
-       namep += strlen (namep) + 1, i += 1)
+       namep = strnul (namep) + 1, i += 1)
     {
       ASSERT (strlen (namep) == 1);
       ASSERT (*namep - 'a' == i);