diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-17 14:07:19 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-17 14:07:19 +0000 |
commit | 984762cd6070badb10e5dcb8d596180b5d749f70 (patch) | |
tree | 75052708c391d6b389b6384786f4b95e7ee73642 | |
parent | 3ee9e1f1f13ddd3371f75891ad91b45a90910ac1 (diff) | |
download | rsyslog-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.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -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: |