diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-31 11:02:58 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-31 11:02:58 +0100 |
commit | 7783f518f63f885808639374091ea5a67038c935 (patch) | |
tree | f9f464ff1d05f577afa7cbb3563217c292a0ef23 /nss | |
parent | 20683054f699ca3dec7be6f847255819c42a5966 (diff) |
extract some more common macros
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@208 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss')
-rw-r--r-- | nss/hosts.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/nss/hosts.c b/nss/hosts.c index 92aacf1..449506b 100644 --- a/nss/hosts.c +++ b/nss/hosts.c @@ -88,9 +88,7 @@ static enum nss_status read_hostent( /* Note: this may allocate too much memory (e.g. also for address records of other address families) but this is an easy way to do it */ - BUF_CHECK(fp,(numaddr+1)*sizeof(char *)); - result->h_addr_list=(char **)BUF_CUR; - BUF_SKIP((numaddr+1)*sizeof(char *)); + BUF_ALLOC(fp,result->h_addr_list,char *,numaddr+1); /* go through the address list and filter on af */ i=0; while (--numaddr>=0) @@ -100,12 +98,9 @@ static enum nss_status read_hostent( READ_INT32(fp,tmp2int32); if (readaf==af) { + /* read the address */ result->h_length=tmp2int32; - /* allocate room in buffer */ - BUF_CHECK(fp,tmp2int32); - READ(fp,BUF_CUR,(size_t)tmp2int32); - result->h_addr_list[i++]=BUF_CUR; - BUF_SKIP(tmp2int32); + READ_BUF(fp,result->h_addr_list[i++],tmp2int32); } else { |