From: michael Date: Tue, 13 Jan 2015 19:01:23 +0000 (+0000) Subject: - scan.c:scan_manual(): replaced inet_ntoa() with inet_ntop() X-Git-Tag: 1.1.0beta1~170 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=03c8870890df3cefeaf55e765f665d2fd477f895;p=hopm.git - scan.c:scan_manual(): replaced inet_ntoa() with inet_ntop() git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5374 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/scan.c b/src/scan.c index 7cd76ad..acbe99c 100644 --- a/src/scan.c +++ b/src/scan.c @@ -861,10 +861,11 @@ scan_irckline(const struct scan_struct *ss, const char *format, const char *type void scan_manual(char *param, const struct ChannelConf *target) { - struct in_addr *addr; + char buf[INET6_ADDRSTRLEN]; + const void *addr = NULL; struct scan_struct *ss; struct scanner_struct *scs; - char *ip; + const char *ip = NULL; char *scannername; node_t *p; int ret; @@ -897,7 +898,11 @@ scan_manual(char *param, const struct ChannelConf *target) } /* IP = the resolved IP now (it was the ip OR hostname before) */ - ip = inet_ntoa(*addr); + if ((ip = inet_ntop(AF_INET, addr, buf, sizeof(buf))) == NULL) + { + irc_send("PRIVMSG %s :CHECK -> invalid address: %s", strerror(errno)); + return; + } ss = xcalloc(sizeof *ss); ss->ip = xstrdup(ip);