aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-03-21 16:16:59 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-03-21 16:16:59 +0000
commitd5cf42fa75363bd2254582cc74e24c0ef33fabe1 (patch)
tree4d722b5e777d9ea43129d25b665443ed77af7dd8
parentf85c9d8ce690267f9b767aaaf877c87099404c9d (diff)
downloadfetchmail-d5cf42fa75363bd2254582cc74e24c0ef33fabe1.tar.gz
fetchmail-d5cf42fa75363bd2254582cc74e24c0ef33fabe1.tar.bz2
fetchmail-d5cf42fa75363bd2254582cc74e24c0ef33fabe1.zip
suffix test was reversed.
svn path=/trunk/; revision=2832
-rw-r--r--checkalias.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/checkalias.c b/checkalias.c
index a16e04ca..28d7861f 100644
--- a/checkalias.c
+++ b/checkalias.c
@@ -131,15 +131,15 @@ int is_host_alias(const char *name, struct query *ctl)
char *ep;
/*
- * Test is <= here because str_in_list() should have caught the
+ * Test is >= here because str_in_list() should have caught the
* equal-length case above. Doing it this way guarantees that
* ep[-1] is a valid reference.
*/
- if (strlen(idl->id) <= namelen)
+ if (strlen(idl->id) >= namelen)
continue;
- ep = idl->id + (strlen(idl->id) - namelen);
+ ep = (char *)name + (namelen - strlen(idl->id));
/* a suffix led by . must match */
- if (ep[-1] == '.' && !strcmp(ep, name))
+ if (ep[-1] == '.' && !strcmp(ep, idl->id))
return(TRUE);
}