svn commit: branches/uClibc_0_9_28/libc/inet
andersen at uclibc.org
andersen at uclibc.org
Thu Feb 8 21:01:06 UTC 2007
Author: andersen
Date: 2007-02-08 13:01:06 -0800 (Thu, 08 Feb 2007)
New Revision: 17824
Log:
do not use ghbn_buf after it goes out of scope
Modified:
branches/uClibc_0_9_28/libc/inet/hostid.c
Changeset:
Modified: branches/uClibc_0_9_28/libc/inet/hostid.c
===================================================================
--- branches/uClibc_0_9_28/libc/inet/hostid.c 2007-02-08 20:41:41 UTC (rev 17823)
+++ branches/uClibc_0_9_28/libc/inet/hostid.c 2007-02-08 21:01:06 UTC (rev 17824)
@@ -55,19 +55,18 @@
if (gethostname(host,MAXHOSTNAMELEN)>=0 && *host) {
struct hostent *hp;
struct in_addr in;
+ struct hostent ghbn_h;
+ char ghbn_buf[sizeof(struct in_addr) +
+ sizeof(struct in_addr *)*2 +
+ sizeof(char *)*((2 + 5/*MAX_ALIASES*/ +
+ 1)/*ALIAS_DIM*/) +
+ 256/*namebuffer*/ + 32/* margin */];
+ int ghbn_errno;
/* replace gethostbyname() with gethostbyname_r() - ron at zing.net */
/*if ((hp = gethostbyname(host)) == (struct hostent *)NULL)*/
- {
- struct hostent ghbn_h;
- char ghbn_buf[sizeof(struct in_addr) +
- sizeof(struct in_addr *)*2 +
- sizeof(char *)*((2 + 5/*MAX_ALIASES*/ +
- 1)/*ALIAS_DIM*/) +
- 256/*namebuffer*/ + 32/* margin */];
- int ghbn_errno;
- gethostbyname_r(host, &ghbn_h, ghbn_buf, sizeof(ghbn_buf), &hp, &ghbn_errno);
- }
+ gethostbyname_r(host, &ghbn_h, ghbn_buf, sizeof(ghbn_buf), &hp, &ghbn_errno);
+
if (hp == (struct hostent *)NULL)
/* This is not a error if we get here, as all it means is that
More information about the uClibc-cvs
mailing list