From: Alejandro Colomar Date: Sat, 15 Nov 2025 20:58:10 +0000 (+0100) Subject: lib/: Rename XREALLOC() => xrealloc_T() X-Git-Tag: 4.19.0-rc1~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01a0aac628efe0765e2e775615f6452244842017;p=thirdparty%2Fshadow.git lib/: Rename XREALLOC() => xrealloc_T() The 'T' in the name notes that this API is a type-safe variant of the API it wraps. This makes the names more explicative. Signed-off-by: Alejandro Colomar --- diff --git a/lib/alloc/realloc.h b/lib/alloc/realloc.h index af582e9c..ac9f046e 100644 --- a/lib/alloc/realloc.h +++ b/lib/alloc/realloc.h @@ -25,7 +25,8 @@ #define reallocarray_(p, n, size) reallocarray(p, (n) ?: 1, (size) ?: 1) -#define XREALLOC(p, n, T) exit_if_null(realloc_T(p, n, T)) +// xrealloc_T - exit-on-error realloc type-safe +#define xrealloc_T(p, n, T) exit_if_null(realloc_T(p, n, T)) #endif // include guard diff --git a/lib/env.c b/lib/env.c index 95b4ed5c..97339c64 100644 --- a/lib/env.c +++ b/lib/env.c @@ -135,7 +135,7 @@ void addenv (const char *string, /*@null@*/const char *value) update_environ = (environ == newenvp); - newenvp = XREALLOC(newenvp, newenvc + NEWENVP_STEP, char *); + newenvp = xrealloc_T(newenvp, newenvc + NEWENVP_STEP, char *); /* * If this is our current environment, update diff --git a/lib/xgetXXbyYY.c b/lib/xgetXXbyYY.c index 1a4ca94b..8b7fc543 100644 --- a/lib/xgetXXbyYY.c +++ b/lib/xgetXXbyYY.c @@ -61,7 +61,7 @@ while (true) { int status; LOOKUP_TYPE *resbuf = NULL; - buffer = XREALLOC(buffer, length, char); + buffer = xrealloc_T(buffer, length, char); status = REENTRANT_NAME(ARG_NAME, result, buffer, length, &resbuf); if ((0 == status) && (resbuf == result)) { diff --git a/src/newgrp.c b/src/newgrp.c index 3bf7291a..77e57be5 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -671,7 +671,7 @@ int main (int argc, char **argv) * If the group doesn't fit, I'll complain loudly and skip this * part. */ - gids = XREALLOC(gids, ngroups + 1, gid_t); + gids = xrealloc_T(gids, ngroups + 1, gid_t); LSEARCH(gid_t, &gid, gids, &ngroups);