* lib/userspec.c (parse_with_separator): Prefer idx_t to size_t for indexes, using idx_t-related allocators. --- ChangeLog | 1 + lib/userspec.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog index fc3c91d63..e14aeb06a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ * lib/readutmp.c (read_utmp): * lib/savedir.c (streamsavedir): * lib/stack.h (_GL_STACK_TYPE, _GL_STACK_PREFIX): + * lib/userspec.c (parse_with_separator): 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. diff --git a/lib/userspec.c b/lib/userspec.c index 68d54b4a1..a58c4896b 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -134,10 +134,10 @@ parse_with_separator (char const *spec, char const *separator, } else { - size_t ulen = separator - spec; + idx_t ulen = separator - spec; if (ulen != 0) { - u = xmemdup (spec, ulen + 1); + u = ximemdup (spec, ulen + 1); u[ulen] = '\0'; } } -- 2.30.2