aboutsummaryrefslogtreecommitdiff
path: root/nis/nss_nisplus/nisplus-parser.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-14 20:39:47 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-14 20:39:47 +0000
commit3fc044a1138a1afef86c4071b5fc15e940bed5b8 (patch)
treea2e3b9449f9dbbab98043ccb42fe76dd5bb9dee0 /nis/nss_nisplus/nisplus-parser.c
parent0433a3502d98e2c6c1c6a496f4ae521566a2a7b9 (diff)
downloadglibc-3fc044a1138a1afef86c4071b5fc15e940bed5b8.zip
glibc-3fc044a1138a1afef86c4071b5fc15e940bed5b8.tar.gz
glibc-3fc044a1138a1afef86c4071b5fc15e940bed5b8.tar.bz2
* nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_parse_aliasent):
Avoid unnecessary allocation. Fix adjustment for pointer value.
Diffstat (limited to 'nis/nss_nisplus/nisplus-parser.c')
-rw-r--r--nis/nss_nisplus/nisplus-parser.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nis/nss_nisplus/nisplus-parser.c b/nis/nss_nisplus/nisplus-parser.c
index a3da5a2..e41751f 100644
--- a/nis/nss_nisplus/nisplus-parser.c
+++ b/nis/nss_nisplus/nisplus-parser.c
@@ -211,11 +211,12 @@ _nss_nisplus_parse_grent (nis_result *result, u_long entry, struct group *gr,
first_unused += (len + 1);
/* Adjust the pointer so it is aligned for
storing pointers. */
- first_unused += __alignof__ (char *) - 1;
- size_t adjust = ((first_unused - (char *) 0) % __alignof__ (char *));
+ size_t adjust = ((__alignof__ (char *)
+ - (first_unused - (char *) 0) % __alignof__ (char *))
+ % __alignof__ (char *));
if (room_left < adjust)
goto no_more_room;
- first_unused -= adjust;
+ first_unused += adjust;
room_left -= adjust;
gr->gr_mem = (char **) first_unused;