diff options
Diffstat (limited to 'nis/nss_nisplus/nisplus-proto.c')
-rw-r--r-- | nis/nss_nisplus/nisplus-proto.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nis/nss_nisplus/nisplus-proto.c b/nis/nss_nisplus/nisplus-proto.c index 02d8dbb658..0b96153819 100644 --- a/nis/nss_nisplus/nisplus-proto.c +++ b/nis/nss_nisplus/nisplus-proto.c @@ -78,8 +78,11 @@ _nss_nisplus_parse_protoent (nis_result *result, struct protoent *proto, proto->p_proto = atoi (NISENTRYVAL (0, 2, result)); + /* XXX Rewrite at some point to allocate the array first and then + copy the strings. It wasteful to first concatenate the strings + to just split them again later. */ char *line = first_unused; - for (i = 0; i < result->objects.objects_len; ++i) + for (i = 0; i < NIS_RES_NUMOBJ (result); ++i) { if (strcmp (NISENTRYVAL (i, 1, result), proto->p_name) != 0) { |