diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-01-24 00:37:30 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-01-24 00:37:30 +0000 |
commit | 5a1dd0c605715b4324fdd08b8e1989aed8a94eb8 (patch) | |
tree | 2ca5fbbae5ba23bf0be25d6796875e0c56329a2f /interface.c | |
parent | c5c26b53354e99ec1cbb324e4ab6cec6aaff9e02 (diff) | |
download | fetchmail-5a1dd0c605715b4324fdd08b8e1989aed8a94eb8.tar.gz fetchmail-5a1dd0c605715b4324fdd08b8e1989aed8a94eb8.tar.bz2 fetchmail-5a1dd0c605715b4324fdd08b8e1989aed8a94eb8.zip |
Correct the interface parsing.
svn path=/trunk/; revision=818
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/interface.c b/interface.c index 19bbd820..6342df7c 100644 --- a/interface.c +++ b/interface.c @@ -98,19 +98,16 @@ static int get_ifinfo(const char *ifname, ifinfo_t *ifinfo) return(result); } -void interface_parse(struct hostdata *hp) +void interface_parse(char *buf, struct hostdata *hp) /* parse 'interface' specification */ { char *cp1, *cp2; - /* if no interface specification present, all done */ - if (!hp->interface) - return; - /* find and isolate just the IP address */ - if (!(cp1 = strchr(hp->interface, '/'))) + if (!(cp1 = strchr(buf, '/'))) (void) error(PS_SYNTAX, 0, "missing IP interface address"); *cp1++ = '\000'; + hp->interface = xstrdup(buf); /* find and isolate just the netmask */ if (!(cp2 = strchr(cp1, '/'))) |