aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-09-03 22:29:48 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-09-03 22:29:48 +0000
commit1e0f66859d25013ddcf198d27e5fe80ddbd56203 (patch)
treebadb1fe5df86589318090951bed270756323156a
parent08ec76e17deb0bcb952877d714029241f9dae766 (diff)
downloadfetchmail-1e0f66859d25013ddcf198d27e5fe80ddbd56203.tar.gz
fetchmail-1e0f66859d25013ddcf198d27e5fe80ddbd56203.tar.bz2
fetchmail-1e0f66859d25013ddcf198d27e5fe80ddbd56203.zip
Use inet_aton.
svn path=/trunk/; revision=1289
-rw-r--r--NEWS1
-rw-r--r--socket.c14
2 files changed, 2 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index e99eea28..8e8aba72 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ fetchmail-4.1.2 ()
* Al Youngwerth's fix to prevent segfaults when Return-Path has no address.
* Phillippe De Muyter's port changes for sysV68 R3V7.1.
* Port changes for Kerberos under FreeBSD, thanks to Benjamin Greenwald.
+* Don't use inet_addr() any more.
There are 285 people on the fetchmail-friends list.
diff --git a/socket.c b/socket.c
index 5fe0683c..260d7cf2 100644
--- a/socket.c
+++ b/socket.c
@@ -25,14 +25,6 @@
#endif
#include "socket.h"
-#ifndef INADDR_NONE
-#ifdef INADDR_BROADCAST
-#define INADDR_NONE INADDR_BROADCAST
-#else
-#define INADDR_NONE -1
-#endif
-#endif
-
#ifdef SUNOS
#include <memory.h>
#endif
@@ -40,17 +32,13 @@
int SockOpen(char *host, int clientPort)
{
int sock;
- unsigned long inaddr;
struct sockaddr_in ad;
struct hostent *hp;
memset(&ad, 0, sizeof(ad));
ad.sin_family = AF_INET;
- inaddr = inet_addr(host);
- if (inaddr != INADDR_NONE)
- memcpy(&ad.sin_addr, &inaddr, sizeof(inaddr));
- else
+ if (!inet_aton(host, &ad.sin_addr)) /* accept a quad address */
{
hp = gethostbyname(host);