]> Savannah Git Hosting - gnulib.git/commitdiff
xgethostname: prefer idx_t for indexes
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jun 2021 00:18:58 +0000 (17:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Jun 2021 00:20:13 +0000 (17:20 -0700)
* lib/xgethostname.c (XGETANAME):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

ChangeLog
lib/xgethostname.c

index e14aeb06a703bb5e5f0dfd96e65322c1e5d7fde5..c9fd316ab4ecb14a46adda13546a24a10aafab42 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
        * lib/savedir.c (streamsavedir):
        * lib/stack.h (_GL_STACK_TYPE, _GL_STACK_PREFIX):
        * lib/userspec.c (parse_with_separator):
+       * lib/xgethostname.c (XGETANAME):
        Prefer idx_t to size_t for indexes, and use idx_t-related allocators.
        * lib/basename.c: Do not include xstrndup.h.
        (basename): Simplify by always using memcpy.
index 87ae6dce8776103690f45e35c392e900bd628ecc..84c2f279bbf22dfe2e884f9746e521f47b171e5c 100644 (file)
@@ -59,7 +59,7 @@ XGETANAME (void)
              specify whether a truncated name is null-terminated.  */
           idx_t actual_size = strlen (name) + 1;
           if (actual_size < size_1)
-            return alloc ? alloc : xmemdup (name, actual_size);
+            return alloc ? alloc : ximemdup (name, actual_size);
           errno = 0;
         }
       free (alloc);