summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-17 14:07:19 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-17 14:07:19 +0000
commit984762cd6070badb10e5dcb8d596180b5d749f70 (patch)
tree75052708c391d6b389b6384786f4b95e7ee73642
parent3ee9e1f1f13ddd3371f75891ad91b45a90910ac1 (diff)
downloadrsyslog-984762cd6070badb10e5dcb8d596180b5d749f70.tar.gz
rsyslog-984762cd6070badb10e5dcb8d596180b5d749f70.tar.xz
rsyslog-984762cd6070badb10e5dcb8d596180b5d749f70.zip
cleaned up code. removed conditional construct where "fromHost" could not
be NULL
-rw-r--r--syslogd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/syslogd.c b/syslogd.c
index 2d4a47c1..53653ac9 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1105,15 +1105,9 @@ static inline int MaskCmp(struct NetAddr *pAllow, uint8_t bits, struct sockaddr
assert(pFrom != NULL);
if(F_ISSET(pAllow->flags, ADDR_NAME)) {
- dprintf ("MaskCmp: host=\"%s\"; pattern=\"%s\"\n",
- pszFromHost == NULL ? "(NULL)" : pszFromHost, pAllow->addr.HostWildcard);
- // TODO: check NULL case - can this happen at all?
+ dprintf ("MaskCmp: host=\"%s\"; pattern=\"%s\"\n", pszFromHost, pAllow->addr.HostWildcard);
- if (pszFromHost != NULL)
- return (fnmatch (pAllow->addr.HostWildcard, pszFromHost,
- FNM_NOESCAPE|FNM_CASEFOLD) == 0);
- else
- return 0;
+ return(fnmatch(pAllow->addr.HostWildcard, pszFromHost, FNM_NOESCAPE|FNM_CASEFOLD) == 0);
} else {/* We need to compare an IP address */
switch (pFrom->sa_family) {
case AF_INET: