[PATCH 09/27] libnetworking: Match gethostbyname_r with prototype.
Christian Mauderer
christian.mauderer at embedded-brains.de
Fri Jun 24 09:38:28 UTC 2016
From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>
---
cpukit/libnetworking/libc/gethostnamadr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c
index a718820..cf0a12d 100644
--- a/cpukit/libnetworking/libc/gethostnamadr.c
+++ b/cpukit/libnetworking/libc/gethostnamadr.c
@@ -371,7 +371,7 @@ nodata:
int gethostbyname_r(const char* name,
struct hostent* result,
char *buf,
- int buflen,
+ size_t buflen,
struct hostent **RESULT,
int *h_errnop)
{
@@ -414,13 +414,13 @@ int gethostbyname_r(const char* name,
{
struct hostent* r;
- struct hostent* he_buf = buf;
+ struct hostent* he_buf = (struct hostent *)buf;
char *work_buf = buf + sizeof(struct hostent);
size_t remain_len = buflen - sizeof(struct hostent);
int he_errno;
sethostent(0);
- while (gethostent_r(he_buf, buf, remain_len, &r, &he_errno) == 0) {
+ while (gethostent_r(he_buf, work_buf, remain_len, &r, &he_errno) == 0) {
int i;
if (r->h_addrtype==AF_INET && !strcasecmp(r->h_name,name)) { /* found it! */
found:
--
1.8.4.5
More information about the devel
mailing list