summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Richard Basch <probe@mit.edu>1994-08-29 13:59:33 +0000
committerGravatar Richard Basch <probe@mit.edu>1994-08-29 13:59:33 +0000
commit2ff92a4408331b087dc4637bb1b5ac87a8ed5e27 (patch)
tree2cf291e2e0cc831cb06e5e3bdce09bd4776d8159 /zwgc
parenta40c59b5b43d23665e557763dca8b57914d71ce2 (diff)
Do not try to reverse resolve 0.0.0.0
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/notice.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/zwgc/notice.c b/zwgc/notice.c
index e6e511f..543f272 100644
--- a/zwgc/notice.c
+++ b/zwgc/notice.c
@@ -307,10 +307,14 @@ char *decode_notice(notice)
/*
* Convert host notice sent from to ascii:
*/
- fromhost = gethostbyaddr(&(notice->z_sender_addr), sizeof(struct in_addr),
- AF_INET);
- var_set_variable("fromhost", fromhost ? fromhost->h_name :
- inet_ntoa(notice->z_sender_addr));
+ if (notice->z_sender_addr.s_addr) {
+ fromhost = gethostbyaddr(&(notice->z_sender_addr),
+ sizeof(struct in_addr), AF_INET);
+ var_set_variable("fromhost", fromhost ? fromhost->h_name :
+ inet_ntoa(notice->z_sender_addr));
+ } else {
+ var_set_variable("fromhost", inet_ntoa(notice->z_sender_addr));
+ }
/*
* Set $message to the message field of the notice with nulls changed